private function hardDelete(Page $page)
    {
        if (!$page->isDeleted()) {
            throw new BadRequestHttpException('Page is not in trash, cannot remove it.');
        }

        if (true === $page->isRoot()) {
            throw new BadRequestHttpException('Cannot remove root page of a site.');
        }

        $this->granted('DELETE', $page);

        $this->getPageRepository()->deletePage($page);
    }
private function hardDelete(Page $page)
    {
        if (!$page->isDeleted()) {
            throw new BadRequestHttpException('Page is not in trash, cannot remove it.');
        }

        if (true === $page->isRoot()) {
            throw new BadRequestHttpException('Cannot remove root page of a site.');
        }

        $this->granted('DELETE', $page);

        $this->getPageRepository()->deletePage($page);
    }
private function hardDelete ( Page $ page ) { if ( ! $ page -> isDeleted ( ) ) { throw new BadRequestHttpException ( 'Page is not in trash, cannot remove it.' ) ; } if ( true === $ page -> isRoot ( ) ) { throw new BadRequestHttpException ( 'Cannot remove root page of a site.' ) ; } $ this -> granted ( 'DELETE' , $ page ) ; $ this -> getPageRepository ( ) -> deletePage ( $ page ) ; }
Remove page from the database.

@param  Page $page The page to be removeed.

@throws BadRequestHttpException Occures if $page is not in trash or is a root.
Remove page from the database .