From e086905384837e49e772fc893451ad0c5a3cb0ce Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 27 Jan 2015 14:52:13 +0100 Subject: [PATCH] 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. --- .../monitoring/library/Monitoring/DataView/DataView.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/monitoring/library/Monitoring/DataView/DataView.php b/modules/monitoring/library/Monitoring/DataView/DataView.php index 5900df737..da48f31c3 100644 --- a/modules/monitoring/library/Monitoring/DataView/DataView.php +++ b/modules/monitoring/library/Monitoring/DataView/DataView.php @@ -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));