- Fixed some bugs regarding parameter binding
This commit is contained in:
1 parent
0550036fd9
commit
b1adf5a086
4 files changed
+19
-10
No files matched your search
@@ -13,7 +13,7 @@ use Ulmus\{Api\SearchRequest\Attribute\BindParameter,
|
||||
|
||||
class ApiSearchRequest extends SearchRequest implements SearchRequestInterface
|
||||
{
|
||||
use SearchRequestPaginationTrait, SearchRequestFromRequestTrait {
|
||||
use /*SearchRequestPaginationTrait,*/ SearchRequestFromRequestTrait {
|
||||
parseAttributeMethod as parseAttributeMethodParent;
|
||||
}
|
||||
|
||||
@@ -26,14 +26,18 @@ class ApiSearchRequest extends SearchRequest implements SearchRequestInterface
|
||||
], fn($i) => !is_null($i)) + [];
|
||||
}
|
||||
|
||||
protected function parseAttributeMethod(object $attribute, string $field, string $propertyName,): void
|
||||
protected function parseAttributeMethod(object $attribute, string|\Stringable $field, string $propertyName) : void
|
||||
{
|
||||
switch ($attribute->method) {
|
||||
case SearchMethodEnum::Where:
|
||||
case SearchMethodEnum::Manual:
|
||||
if ($attribute instanceof BindParameter) {
|
||||
$this->bindings[$field] = $this->$propertyName;
|
||||
if (isset($this->$propertyName)) {
|
||||
$this->bindings[(string)$field] = $this->$propertyName;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->parseAttributeMethodParent($attribute, $field, $propertyName);
|
||||
|
||||
Reference in new issue
Block a user