- WIP on SearchRequest enums and manual searchs
This commit is contained in:
1 parent
0c8591f238
commit
62998faf40
6 files changed
+88
-22
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Ulmus\Entity\Sqlite;
|
||||
|
||||
use Notes\Common\ReflectedProperty;
|
||||
use Ulmus\EntityCollection;
|
||||
|
||||
use Ulmus\{Attribute\Obj\Table};
|
||||
@@ -32,4 +33,29 @@ class Column
|
||||
|
||||
#[Field(name: "pk")]
|
||||
public bool $primaryKey;
|
||||
|
||||
public function matchFieldDefinition(ReflectedProperty $definition) : bool
|
||||
{
|
||||
if ($this->notNull === $definition->allowsNull()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($definition->value)) {
|
||||
if ( $definition->value !== $this->defaultValue) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
elseif (! isset($definition->value)) {
|
||||
if ( ! $this->defaultValueIsNull() ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function defaultValueIsNull() : bool
|
||||
{
|
||||
return $this->defaultValue === null || $this->defaultValue === "NULL";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user