- WIP on SQLite Adapter and migration
This commit is contained in:
1 parent
cee978ecfd
commit
9514a46ae7
14 files changed
+98
-40
No files matched your search
@@ -13,13 +13,23 @@ class Where {
|
||||
public string $operator = Query\Where::OPERATOR_EQUAL,
|
||||
public string $condition = Query\Where::CONDITION_AND,
|
||||
public string|\Stringable|array|null $fieldValue = null,
|
||||
public null|array $generateValue = null,
|
||||
) {
|
||||
$this->field = Attribute::handleArrayField($field);
|
||||
$this->fieldValue = Attribute::handleArrayField($fieldValue);
|
||||
}
|
||||
|
||||
public function getValue() : mixed
|
||||
public function getValue(/* null|EntityInterface */ $entity = null) : mixed
|
||||
{
|
||||
if ($this->generateValue) {
|
||||
if ($entity) {
|
||||
return call_user_func_array($this->generateValue, [ $entity ]);
|
||||
}
|
||||
else {
|
||||
throw new \Exception(sprintf("Could not generate value from non-instanciated entity for field %s.", (string) $this->field));
|
||||
}
|
||||
}
|
||||
|
||||
return $this->fieldValue ?? $this->value;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user