- Fixed 'value' for SearchRequestOrderBy and also fixed a typo where SearchManual would not be set

This commit is contained in:
Dave Mc Nicoll 2024-10-07 19:38:29 +00:00
parent 4106c8db91
commit 3ba8a2a5d0
2 changed files with 17 additions and 8 deletions

View File

@ -12,12 +12,20 @@ class Datetime extends \DateTime implements EntityObjectInterface {
{
$value = $arguments[0];
try {
# From Timestamp
if ( is_numeric($value) ) {
return new static("@$value");
$obj = new static("@$value");
}
else {
$obj = new static($value);
}
}
catch(\Throwable $ex) {
throw new \Exception(sprintf("An error occured trying to instanciate from '%s'. %s", $value, $ex->getMessage()), $ex->getCode(), $ex);
}
return new static($value);
return $obj;
}
public function save()

View File

@ -60,6 +60,8 @@ trait SearchRequestFromRequestTrait
$field = $fieldName;
}
$value = $this->getValueFromSource($request, $propertyName, $attribute);
switch(true) {
case $attribute instanceof SearchGroupBy:
$this->parseAttributeGroupBy($attribute, $field, $propertyName);
@ -67,14 +69,13 @@ trait SearchRequestFromRequestTrait
case $attribute instanceof SearchWhere:
case $attribute instanceof SearchLike:
case $attribute instanceof SearchManuel:
$value = $this->getValueFromSource($request, $propertyName, $attribute);
case $attribute instanceof SearchManual:
if ($value !== null) {
$value = $this->transformValue($property->getAttributes(Attribute\PropertyValueModifier::class), $value);
}
dump($value);
if ($attribute->toggle) {
$this->$propertyName = !empty($value);
} elseif ($value !== null) {