- WIP on search request handling of operators

This commit is contained in:
Dave Mc Nicoll committed 2025-11-11 18:22:44 +00:00
1 parent 2271b0b034
commit cb125545c7
6 files changed
+60 -29

No files matched your search

@@ -199,6 +199,36 @@ trait SearchRequestFromRequestTrait
return $this;
}
/* [[ Boilerplates which are ready to be copied */
public function wheres() : iterable
{
return array_filter($this->wheres + [
], fn($i) => ! is_null($i) ) + [ ];
}
public function likes(): iterable
{
return array_filter($this->likes + [
], fn($i) => ! is_null($i) ) + [];
}
public function groups(): iterable
{
return array_filter($this->groups + [
], fn($e) => ! is_null($e) && $e !== "" );
}
public function orders(): iterable
{
return array_filter($this->orders + [
], fn($e) => ! is_null($e) && $e !== "" );
}
/* ]] */
protected function getValueFromSource(RequestInterface $request, string $propertyName, SearchParameter $attribute) : mixed
{
$queryParamName = $attribute->getParameters() ?: [ $propertyName ];