public function replaceRootContentSet(ContentSet $contentToReplace, ContentSet $newContentSet, $checkContentsLinkToParent = true)
    {
        $checkContentsLinkToParent = (true === $checkContentsLinkToParent);
        $contentIsLinked = true === $checkContentsLinkToParent ? $this->isLinkedToHisParentBy($contentToReplace) : true;

        if (true === $contentIsLinked) {
            if (null !== $this->getContentSet()) {
                $this->getContentSet()->replaceChildBy($contentToReplace, $newContentSet);
            }
        }

        return $newContentSet;
    }
public function replaceRootContentSet(ContentSet $contentToReplace, ContentSet $newContentSet, $checkContentsLinkToParent = true)
    {
        $checkContentsLinkToParent = (true === $checkContentsLinkToParent);
        $contentIsLinked = true === $checkContentsLinkToParent ? $this->isLinkedToHisParentBy($contentToReplace) : true;

        if (true === $contentIsLinked) {
            if (null !== $this->getContentSet()) {
                $this->getContentSet()->replaceChildBy($contentToReplace, $newContentSet);
            }
        }

        return $newContentSet;
    }
public function replaceRootContentSet ( ContentSet $ contentToReplace , ContentSet $ newContentSet , $ checkContentsLinkToParent = true ) { $ checkContentsLinkToParent = ( true === $ checkContentsLinkToParent ) ; $ contentIsLinked = true === $ checkContentsLinkToParent ? $ this -> isLinkedToHisParentBy ( $ contentToReplace ) : true ; if ( true === $ contentIsLinked ) { if ( null !== $ this -> getContentSet ( ) ) { $ this -> getContentSet ( ) -> replaceChildBy ( $ contentToReplace , $ newContentSet ) ; } } return $ newContentSet ; }
Replaces the ContentSet of the page.

@param  ContentSet           $contentToReplace
@param  ContentSet           $newContentSet
@param  boolean              $checkContentsLinkToParent

@return ContentSet
Replaces the ContentSet of the page .