monitoring: Deprecate DataView::addFilter() and DataView::setFilter()

The from now on deprecated interface Filterable has proven that it sucks in the DataView.
Because of requiring us to implement trillion stupid methods, only DataView::applyFilter()
does not forget to handle column validation. Thus only DataView::applyFilter() must be used in order
to apply filters.
For setFilter() a wrapping Filter::matchAny() for the IdoQuery (or the DbQuery or the SimpleQuery I didn't have a look)
is required for the filter to work properly.
The deprecation is just for the records. I guess we do not use the other methods.
This commit is contained in:
Eric Lippmann 2015-01-27 14:52:13 +01:00
parent c53b1d27e9
commit e086905384
1 changed files with 9 additions and 0 deletions

View File

@ -355,12 +355,21 @@ abstract class DataView implements Browsable, Countable, Filterable, Sortable
return $this;
}
/**
* @deprecated(EL): Only use DataView::applyFilter() for applying filter because all other functions are missing
* column validation. Filter::matchAny() for the IdoQuery (or the DbQuery or the SimpleQuery I didn't have a look)
* is required for the filter to work properly.
*/
public function setFilter(Filter $filter)
{
$this->query->setFilter($filter);
return $this;
}
/**
* @deprecated(EL): Only use DataView::applyFilter() for applying filter because all other functions are missing
* column validation.
*/
public function addFilter(Filter $filter)
{
$this->query->addFilter(clone($filter));