/** * Add a filter to the queue based on priority * * @param FilterInterface $filter A Filter * @param integer $priority The command priority, usually between 1 (high priority) and 5 (lowest), * default is 3. If no priority is set, the command priority will be used * instead. * * @return FilterChain */ public function addFilter(FilterInterface $filter, $priority = null) { $priority = $priority == null ? $filter->getPriority() : $priority; $this->_queue->enqueue($filter, $priority); return $this; }
/** * @param FilterInterface $filter * * @return FiltersCollection */ public function add(FilterInterface $filter) { $this->filters[$filter->getPriority()][] = $filter; $this->sorted = null; return $this; }