private function softDelete(Page $page)
    {
        if ($page->isRoot()) {
            throw new BadRequestHttpException('Cannot remove root page of a site.');
        }

        $this->granted('DELETE', $page);
        $this->granted('EDIT', $page->getParent()); // user must have edit permission on parent

        if ($page->isOnline(true)) {
            $this->granted('PUBLISH', $page); // user must have publish permission on the page
        }

        $this->getPageRepository()->toTrash($page);
    }
private function softDelete(Page $page)
    {
        if ($page->isRoot()) {
            throw new BadRequestHttpException('Cannot remove root page of a site.');
        }

        $this->granted('DELETE', $page);
        $this->granted('EDIT', $page->getParent()); // user must have edit permission on parent

        if ($page->isOnline(true)) {
            $this->granted('PUBLISH', $page); // user must have publish permission on the page
        }

        $this->getPageRepository()->toTrash($page);
    }
private function softDelete ( Page $ page ) { if ( $ page -> isRoot ( ) ) { throw new BadRequestHttpException ( 'Cannot remove root page of a site.' ) ; } $ this -> granted ( 'DELETE' , $ page ) ; $ this -> granted ( 'EDIT' , $ page -> getParent ( ) ) ; // user must have edit permission on parent if ( $ page -> isOnline ( true ) ) { $ this -> granted ( 'PUBLISH' , $ page ) ; // user must have publish permission on the page } $ this -> getPageRepository ( ) -> toTrash ( $ page ) ; }
Moves the pages in trash.

@param  Page $page The page to be moved in trash.

@throws BadRequestHttpException Occures if $page is a root.
Moves the pages in trash .