System/Facade/HookHandler.php
/**
     * reads the hooksCollection and checks if any of them are from type After,
     * if yes, then copy the after hooks into the execution hooks array (<b>$calledHooksCollection</b>)
     * @param type $applicationControllerName
     * @param type $applicationControllerMethodName
     * @return \Facade\HookHandler
     */
reads the hooksCollection and checks if any of them are from type After,
if yes, then copy the after hooks into the execution hooks array ($calledHooksCollection)
@param type $applicationControllerName
@param type $applicationControllerMethodName
@return \Facade\HookHandler
reads the hooksCollection and checks if any of them are from type After if yes then copy the after hooks into the execution hooks array ( $calledHooksCollection ) @param type $applicationControllerName @param type $applicationControllerMethodName @return \ Facade \ HookHandler
public function after($applicationControllerName, $applicationControllerMethodName){
        $afterHooks = $this->hooksCollection->getAfterHooks();
        foreach($afterHooks as $hookedClassName => $afterHook){
            foreach($afterHook as $hookedClassMethodName => $hookObject){
                if(ucfirst(strtolower($hookedClassName)) == ucfirst(strtolower($applicationControllerName))){
                    if(ucfirst(strtolower($applicationControllerMethodName)) == ucfirst(strtolower($hookedClassMethodName))){
                        $this->calledHooksCollection[] = $hookObject;
                    }
                }
            }
        }
        return $this;
    }
public function after ( $ applicationControllerName , $ applicationControllerMethodName ) { $ afterHooks = $ this -> hooksCollection -> getAfterHooks ( ) ; foreach ( $ afterHooks as $ hookedClassName => $ afterHook ) { foreach ( $ afterHook as $ hookedClassMethodName => $ hookObject ) { if ( ucfirst ( strtolower ( $ hookedClassName ) ) == ucfirst ( strtolower ( $ applicationControllerName ) ) ) { if ( ucfirst ( strtolower ( $ applicationControllerMethodName ) ) == ucfirst ( strtolower ( $ hookedClassMethodName ) ) ) { $ this -> calledHooksCollection [ ] = $ hookObject ; } } } } return $ this ; }
reads the hooksCollection and checks if any of them are from type After,
 if yes, then copy the after hooks into the execution hooks array (<b>$calledHooksCollection</b>)
 @param type $applicationControllerName
 @param type $applicationControllerMethodName
 @return \Facade\HookHandler
reads the hooksCollection and checks if any of them are from type After if yes then copy the after hooks into the execution hooks array ( <b > $calledHooksCollection< / b > ) @param type $applicationControllerName @param type $applicationControllerMethodName @return \ Facade \ HookHandler
//get a set of hooks registered as type After. //loop through them //each hook should have a set of methods to be hooked with our hook object //and we are looping through these methods //check if the registered HookedClass name is the same as the application controller being called //check if the registered hooked method name is the same as the method being called from the application controller //if yes then add the hook object to the execution hook array //return an instance of this class for method chaining