FilterChain: add and use count() function
This commit is contained in:
parent
39d7d13ddb
commit
1f74c462d4
|
@ -184,7 +184,7 @@ abstract class FilterChain extends Filter
|
||||||
public function addFilter(Filter $filter)
|
public function addFilter(Filter $filter)
|
||||||
{
|
{
|
||||||
$this->filters[] = $filter;
|
$this->filters[] = $filter;
|
||||||
$filter->setId($this->getId() . '-' . (count($this->filters)));
|
$filter->setId($this->getId() . '-' . $this->count());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function &filters()
|
public function &filters()
|
||||||
|
@ -192,6 +192,11 @@ abstract class FilterChain extends Filter
|
||||||
return $this->filters;
|
return $this->filters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function count()
|
||||||
|
{
|
||||||
|
return count($this->filters);
|
||||||
|
}
|
||||||
|
|
||||||
public function __clone()
|
public function __clone()
|
||||||
{
|
{
|
||||||
foreach ($this->filters as & $filter) {
|
foreach ($this->filters as & $filter) {
|
||||||
|
|
Loading…
Reference in New Issue