protected function buildCmsNodeRef($slugKey = 'OriginalSlug')
    {
        if (empty($this->params['Element']))
            throw new Exception('Element parameter is required');

        $nodeElement = $this->ElementService->getBySlug($this->params['Element']);

        if (!is_null($slugKey) && $this->Request->getParameter($slugKey) != '') {
            $slug = $this->Request->getParameter($slugKey);

            $this->nodeRef = new NodeRef($nodeElement, $slug);
        } else {
            $this->nodeRef = new NodeRef($nodeElement);
        }


        return $this->nodeRef;
    }
protected function buildCmsNodeRef($slugKey = 'OriginalSlug')
    {
        if (empty($this->params['Element']))
            throw new Exception('Element parameter is required');

        $nodeElement = $this->ElementService->getBySlug($this->params['Element']);

        if (!is_null($slugKey) && $this->Request->getParameter($slugKey) != '') {
            $slug = $this->Request->getParameter($slugKey);

            $this->nodeRef = new NodeRef($nodeElement, $slug);
        } else {
            $this->nodeRef = new NodeRef($nodeElement);
        }


        return $this->nodeRef;
    }
protected function buildCmsNodeRef ( $ slugKey = 'OriginalSlug' ) { if ( empty ( $ this -> params [ 'Element' ] ) ) throw new Exception ( 'Element parameter is required' ) ; $ nodeElement = $ this -> ElementService -> getBySlug ( $ this -> params [ 'Element' ] ) ; if ( ! is_null ( $ slugKey ) && $ this -> Request -> getParameter ( $ slugKey ) != '' ) { $ slug = $ this -> Request -> getParameter ( $ slugKey ) ; $ this -> nodeRef = new NodeRef ( $ nodeElement , $ slug ) ; } else { $ this -> nodeRef = new NodeRef ( $ nodeElement ) ; } return $ this -> nodeRef ; }
Given a slug, builds a nodeRef

@param string $slugKey The slug to use

@return NodeRef
Given a slug builds a nodeRef