Ldap\Query: Quick fix for naive filter support

Since this will ignore any logical clauses and operators it must be
considered a quick fix and be dropped once real filter support exists.

refs #8826
This commit is contained in:
Johannes Meyer 2015-05-04 16:17:14 +02:00
parent f9089c3e0c
commit 3e8ef5cc0f

View File

@ -126,14 +126,17 @@ class Query extends SimpleQuery
throw new NotImplementedError('Support for Icinga\Data\Filter is still missing. Use $this->where() instead');
}
public function applyFilter(Filter $filter)
{
throw new NotImplementedError('Support for Icinga\Data\Filter is still missing. Use $this->where() instead');
}
public function addFilter(Filter $filter)
{
throw new NotImplementedError('Support for Icinga\Data\Filter is still missing. Use $this->where() instead');
// TODO: This should be considered a quick fix only.
// Drop this entirely once support for Icinga\Data\Filter is available
if ($filter->isExpression()) {
$this->where($filter->getColumn(), $filter->getValue());
} elseif ($filter->isChain()) {
foreach ($filter->filters() as $chainOrExpression) {
$this->addFilter($chainOrExpression);
}
}
}
public function setFilter(Filter $filter)