Mapper default null

This commit is contained in:
Juan Pablo Vial
2024-06-11 12:07:57 -04:00
parent 3fc7aa88dc
commit 5864e7ee94

View File

@ -1,6 +1,7 @@
<?php <?php
namespace Incoviba\Common\Implement\Repository; namespace Incoviba\Common\Implement\Repository;
use Error;
use Closure; use Closure;
use Incoviba\Common\Define; use Incoviba\Common\Define;
@ -46,7 +47,11 @@ class Mapper implements Define\Repository\Mapper
} }
public function hasDefault(): bool public function hasDefault(): bool
{ {
return isset($this->default); try {
return isset($this->default) or $this->default === null;
} catch (Error) {
return false;
}
} }
public function parse(Define\Model &$model, string $column, ?array $data): bool public function parse(Define\Model &$model, string $column, ?array $data): bool