Skip to content

Commit

Permalink
Make explorer and conventions pulic
Browse files Browse the repository at this point in the history
  • Loading branch information
cevro committed Mar 24, 2021
1 parent eed51d8 commit 7b9fdc7
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 14 deletions.
11 changes: 10 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
{
"description": "",
"name": "fykosak/nette-orm",
"type": "library",
"license": "GPL-3.0-or-later",
"version": "0.1.2",
"version": "0.1.3",
"require": {
"php": ">=7.4",
"nette/di": "^3.0.8",
"nette/database": "^3.1",
"ext-pdo": "*"
},
"authors": [
{
"name": "Michal Koutny",
"email": "michal@fykos.cz"
},
{
"name": "Michal Mišo Červeňák",
"email": "miso@fykos.cz"
},
{
"name": "Lukáš Timo",
"email": "lukast@fykos.cz"
}
],
"autoload": {
Expand Down
17 changes: 9 additions & 8 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 11 additions & 5 deletions src/AbstractService.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ abstract class AbstractService {
protected ?array $defaults = null;
private string $modelClassName;
private string $tableName;
private Explorer $explorer;
private Conventions $conventions;
public Explorer $explorer;
private array $columns;

public function __construct(string $tableName, string $modelClassName, Explorer $explorer, Conventions $conventions) {
public final function __construct(string $tableName, string $modelClassName, Explorer $explorer) {
$this->tableName = $tableName;
$this->modelClassName = $modelClassName;
$this->explorer = $explorer;
$this->conventions = $conventions;
}

/**
Expand Down Expand Up @@ -123,12 +121,20 @@ public function store(?AbstractModel $model, array $data): AbstractModel {
}
}

/**
* @return Explorer
* @deprecated
*/
public function getExplorer(): Explorer {
return $this->explorer;
}

/**
* @return Conventions
* @deprecated
*/
public function getConventions(): Conventions {
return $this->conventions;
return $this->explorer->getConventions();
}

/** @return string|AbstractModel */
Expand Down

0 comments on commit 7b9fdc7

Please sign in to comment.