backports murph-skeleton
This commit is contained in:
parent
146533af30
commit
8dcc696595
2 changed files with 9 additions and 41 deletions
|
|
@ -40,27 +40,11 @@ class PostRepositoryQuery extends RepositoryQuery
|
|||
;
|
||||
}
|
||||
|
||||
public function useFilters(array $filters)
|
||||
protected function filterHandler(string $name, $value)
|
||||
{
|
||||
foreach ($filters as $name => $value) {
|
||||
if (null === $value) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_int($value) || is_bool($value)) {
|
||||
$this->andWhere('.'.$name.' = :'.$name);
|
||||
$this->setParameter(':'.$name, $value);
|
||||
} elseif (is_string($value)) {
|
||||
$this->andWhere('.'.$name.' LIKE :'.$name);
|
||||
$this->setParameter(':'.$name, '%'.$value.'%');
|
||||
} else {
|
||||
if ('category' === $name) {
|
||||
$this->inCategory($value);
|
||||
}
|
||||
}
|
||||
if ('category' === $name) {
|
||||
$this->inCategory($value);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function search(?string $keywords, ?string $tag)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue