- Moved withJoin() method of repository into a trait
This commit is contained in:
1 parent
caf5bd9664
commit
c417b00ed4
10 files changed
+205
-118
No files matched your search
@@ -190,7 +190,28 @@ trait SearchRequestFromRequestTrait
|
||||
$this->$propertyName = !empty($value);
|
||||
}
|
||||
elseif ($value !== null) {
|
||||
|
||||
$this->$propertyName = $this->parseValue($property, $value);
|
||||
/*=======
|
||||
foreach ($property->getTypes() as $type) {
|
||||
$enum = $type->type;
|
||||
|
||||
if (enum_exists($enum)) {
|
||||
try {
|
||||
$this->$propertyName = $value instanceof \UnitEnum ? $value : $type->type::from($value);
|
||||
} catch (\ValueError $ex) {
|
||||
$cases = implode(', ', array_map(fn($e) => $e->value, $enum::cases()));
|
||||
|
||||
throw new \ValueError(
|
||||
sprintf("Given value '%s' do not exists within enum '%s'. Try one of those values instead : %s", $value, $enum, $cases)
|
||||
);
|
||||
}
|
||||
}
|
||||
elseif ($type->builtIn || $value instanceof \Stringable ) {
|
||||
$this->$propertyName = $value;
|
||||
}
|
||||
}
|
||||
>>>>>>> d917678 (- Moved withJoin() method of repository into a trait)*/
|
||||
}
|
||||
|
||||
$this->parseAttributeMethod($attribute, $field, $propertyName);
|
||||
|
||||
Reference in new issue
Block a user