- protected function addFilter ($filterGroup, Filterable $filterInstance) {
- $this->filterChains[$filterGroup]->addFilter($filterInstance);
+ protected function addFilter ($filterChain, Filterable $filterInstance) {
+ //* DEBUG: */ self::createDebugInstance(__CLASS__)->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: */ self::createDebugInstance(__CLASS__)->debugOutput('CONTROLLER: ' . $filterChain . ',' . $filterInstance->__toString(). ' add: FINISH');