Call Controllermethod from ControllerHelper

ajnos

Member
Hi,
i'm trying to call a Method from a Controller in the Controller Helper.
PHP:
    public function assertCategoryValidAndViewable($categoryId, array $fetchOptions = array())
    {
        $fetchOptions += array('permissionCombinationId' => $this->_visitor['permission_combination_id']);

        $category = $this->getCategoryOrError($categoryId, $fetchOptions);
        if (isset($forum['node_permission_cache'])) {
            $this->_visitor->setNodePermissions($category['node_id'], $category['node_permission_cache']);
            unset($category['node_permission_cache']);
        }

        if (!$this->_controller->_getCategoryModel()->canView($category, $errorPhraseKey)) {
     #       throw $this->_controller->getErrorOrNoPermissionResponseException($errorPhraseKey);
        }


        return $category;
    }
_getCategoryModel is a valid method in my controller:
PHP:
    /**
     * @return Ragtek_AS_Model_Category
     */
    protected function _getCategoryModel(){
        return $this->getModelFromCache('Ragtek_AS_Model_Category');
    }
If i run this code, i'm getting:
Fatal error: Call to protected method Ragtek_AS_ControllerPublic_Abstract::_getCategoryModel() from context 'Ragtek_AS_ControllerHelper_AC' in C:\xampp\htdocs\xenforo\library\Ragtek\AS\ControllerHelper\AC.php on line 42
 
It's valid, but it's marked as protected, so it can't be called from outside the class.
 
Top Bottom