public function setRoot(Page $root)
    {
        if ($this->hasMainSection()) {
            $this->getMainSection()->setRoot($root->getRoot()->getMainSection());
        }

        return $this;
    }
public function setRoot(Page $root)
    {
        if ($this->hasMainSection()) {
            $this->getMainSection()->setRoot($root->getRoot()->getMainSection());
        }

        return $this;
    }
public function setRoot ( Page $ root ) { if ( $ this -> hasMainSection ( ) ) { $ this -> getMainSection ( ) -> setRoot ( $ root -> getRoot ( ) -> getMainSection ( ) ) ; } return $ this ; }
Sets the root node.

@param  Page                 $root

@return Page
Sets the root node .