protected function initInstance(Armada $instance)
    {
        // Return if the class instance has already been initialized.
        if(!($instance) || ($instance->response))
        {
            return;
        }
        // Init the class instance
        $instance->response = $this->xResponse;
        $instance->rqFactory = new Factory\Request($instance);
        $instance->pgFactory = new Factory\Paginator($instance);

        if(($this->xInitCallback))
        {
            call_user_func_array($this->xInitCallback, array($instance));
        }
        // Apply class initializer
        foreach($this->aClassInitCallbacks as $namespace => $callback)
        {
            $classname = get_class($instance);
            if(strpos($classname, $namespace) !== false)
            {
                // Call the callback passing the class instance as parameter
                $callback($instance);
            }
        }
        // Call the init() function of the instance class
        $instance->init();
    }
protected function initInstance(Armada $instance)
    {
        // Return if the class instance has already been initialized.
        if(!($instance) || ($instance->response))
        {
            return;
        }
        // Init the class instance
        $instance->response = $this->xResponse;
        $instance->rqFactory = new Factory\Request($instance);
        $instance->pgFactory = new Factory\Paginator($instance);

        if(($this->xInitCallback))
        {
            call_user_func_array($this->xInitCallback, array($instance));
        }
        // Apply class initializer
        foreach($this->aClassInitCallbacks as $namespace => $callback)
        {
            $classname = get_class($instance);
            if(strpos($classname, $namespace) !== false)
            {
                // Call the callback passing the class instance as parameter
                $callback($instance);
            }
        }
        // Call the init() function of the instance class
        $instance->init();
    }
protected function initInstance ( Armada $ instance ) { // Return if the class instance has already been initialized. if ( ! ( $ instance ) || ( $ instance -> response ) ) { return ; } // Init the class instance $ instance -> response = $ this -> xResponse ; $ instance -> rqFactory = new Factory \ Request ( $ instance ) ; $ instance -> pgFactory = new Factory \ Paginator ( $ instance ) ; if ( ( $ this -> xInitCallback ) ) { call_user_func_array ( $ this -> xInitCallback , array ( $ instance ) ) ; } // Apply class initializer foreach ( $ this -> aClassInitCallbacks as $ namespace => $ callback ) { $ classname = get_class ( $ instance ) ; if ( strpos ( $ classname , $ namespace ) !== false ) { // Call the callback passing the class instance as parameter $ callback ( $ instance ) ; } } // Call the init() function of the instance class $ instance -> init ( ) ; }
Initialize a class instance.

@return void
Initialize a class instance .