diff --git a/library/Icinga/Data/Filter/FilterChain.php b/library/Icinga/Data/Filter/FilterChain.php index c7697b7ad..e86f6fec9 100644 --- a/library/Icinga/Data/Filter/FilterChain.php +++ b/library/Icinga/Data/Filter/FilterChain.php @@ -184,7 +184,7 @@ abstract class FilterChain extends Filter public function addFilter(Filter $filter) { $this->filters[] = $filter; - $filter->setId($this->getId() . '-' . (count($this->filters))); + $filter->setId($this->getId() . '-' . $this->count()); } public function &filters() @@ -192,6 +192,11 @@ abstract class FilterChain extends Filter return $this->filters; } + public function count() + { + return count($this->filters); + } + public function __clone() { foreach ($this->filters as & $filter) {