add doc about filterHandler
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
c2bcee306d
commit
7c180c3bbb
|
@ -141,6 +141,32 @@ class MyEntityRepositoryQuery extends RepositoryQuery
|
|||
}
|
||||
```
|
||||
|
||||
You can also force `filterHandler` te be used for specific filter field:
|
||||
|
||||
```php-inline
|
||||
// ...
|
||||
|
||||
class MyEntityRepositoryQuery extends RepositoryQuery
|
||||
{
|
||||
public function __construct(Repository $repository, PaginatorInterface $paginator)
|
||||
{
|
||||
// ...
|
||||
|
||||
$this->addForcedFilterHandler('foo');
|
||||
}
|
||||
|
||||
public function filterHandler(string $name, $value): self
|
||||
{
|
||||
// ...
|
||||
|
||||
if ($name === 'foo) {
|
||||
// ...
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Pager
|
||||
|
||||
|
|
Loading…
Reference in a new issue