diff --git a/.gitignore b/.gitignore index 32ce49d..b96b377 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /tests/config.local.neon /tests/temp/* !/tests/temp/.gitignore +coverage.html diff --git a/README.md b/README.md index fdf3a40..9b4b759 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Nette ORM ![GitHub branch checks state](https://img.shields.io/github/checks-status/fykosak/nette-orm/master) - + ## install diff --git a/composer.json b/composer.json index e0e00a1..51d6482 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "name": "fykosak/nette-orm", "type": "library", "license": "GPL-3.0-or-later", - "version": "0.2.0", + "version": "0.2.1", "require": { "php": ">=7.4", "nette/di": "^3.0", diff --git a/composer.lock b/composer.lock index cd888f8..26e5588 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "af1256a9f93963ed604f02c381e2935d", + "content-hash": "97e60e4188849dff959455bc39889d9c", "packages": [ { "name": "nette/caching", diff --git a/src/AbstractService.php b/src/AbstractService.php index 091877e..3e4bf2e 100644 --- a/src/AbstractService.php +++ b/src/AbstractService.php @@ -121,22 +121,6 @@ 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->explorer->getConventions(); - } - /** @return string|AbstractModel */ final public function getModelClassName(): string { return $this->modelClassName; @@ -153,25 +137,6 @@ protected function checkType(AbstractModel $model): void { } } - /** - * Default data for the new model. - * TODO is this really needed? - * @return array - */ - protected function getDefaultData(): array { - if (!isset($this->defaults)) { - $this->defaults = []; - foreach ($this->getColumnMetadata() as $column) { - if ($column['nativetype'] == 'TIMESTAMP' && isset($column['default']) - && !preg_match('/^[0-9]{4}/', $column['default'])) { - continue; - } - $this->defaults[$column['name']] = isset($column['default']) ? $column['default'] : null; - } - } - return $this->defaults; - } - /** * Omits array elements whose keys aren't columns in the table. * @@ -189,7 +154,7 @@ protected function filterData(array $data): array { return $result; } - private function getColumnMetadata(): array { + protected function getColumnMetadata(): array { if (!isset($this->columns)) { $this->columns = $this->explorer->getConnection()->getDriver()->getColumns($this->tableName); }