+ //* DEBUG: */ $this->debugOutput('CONTROLLER: ' . $filterChain . ' init: FINISHED');
+ }
+
+ /**
+ * Adds a filter to a given filter chain
+ *
+ * @param $filterChain Chain of the filter
+ * @param $filterInstance An instance of a filter
+ * @return void
+ * @throws InvalidFilterChainException If the filter chain is invalid
+ */
+ protected function addFilter ($filterChain, Filterable $filterInstance) {
+ //* DEBUG: */ $this->debugOutput('CONTROLLER: ' . $filterChain . ',' . $filterInstance->__toString(). ' add: START');
+
+ // Test if the filter is there
+ if (!isset($this->filterChains[$filterChain])) {
+ // Throw an exception here
+ throw new InvalidFilterChainException(array($this, $filterChain), self::EXCEPTION_FILTER_CHAIN_INVALID);
+ } // END - if
+
+ // Add the filter
+ $this->filterChains[$filterChain]->addFilter($filterInstance);
+ //* DEBUG: */ $this->debugOutput('CONTROLLER: ' . $filterChain . ',' . $filterInstance->__toString(). ' add: FINISH');