@param PageDocument $page

@return bool
969126
public function shouldFormProcess(PageDocument $page)
    {
        return $this->requestStack->getParentRequest() === null
            && $this->requestStack->getCurrentRequest()->getMethod() == Request::METHOD_POST
            && $page->getFormNames()->contains($this->getSubmittedFormName())
        ;
    }
582904
public function isSnapshotActive(PageSnapshotInterface $page)
    {
        $jsonObject = json_decode($page->getVersionedData());

        $now = new \DateTime();

        if ($now->getTimestamp() >= $this->getActiveStart($jsonObject)->getTimestamp() &&
            $now->getTimestamp() <= $this->getActiveEnd($jsonObject)->getTimestamp()
        ) {
            return $jsonObject->status == PageInterface::STATUS_PUBLISHED;
        }

        return false;
    }
892540
public function getPage($page) {
			if (array_key_exists($page, $this->pageCache))
				return $this->pageCache[$page];

			if (!file_exists(sprintf('%s/pages/%s.php', $this->getPluginRoot(), $page)))
				return '<div><strong>Page not found.</strong></div>';
			else {
				ob_start();

				include sprintf('%s/pages/%s.php', $this->getPluginRoot(), $page);

				$data = ob_get_clean();
			}

			$this->pageCache[$page] = $data;

			return $data;
		}
2383
public function hasDocumentDeclaration($entity)
    {
        if ($rootDocument = $this->getClassAnnotation($entity, self::DOCUMENT_CLASS)) {
            return true;
        }

        if ($this->isNested($entity)) {
            return true;
        }

        return false;
    }
706893
protected function isPageEmpty(AbstractPage $page)
    {
        if ($page->get('route')) {
            return false;
        }
        
        if (!$page->hasPages(true)) {
            return true;
        }
        
        $isGranted = $this->getView()->plugin('isGranted');
        foreach ($page->getPages() as $childPage) {
            if (!$childPage->isVisible()) {
                continue;
            }
            
            if ($isGranted($childPage->get('permission'))) {
                return false;
            }
        }
        
        return true;
    }
980565
public function index(Page $page)
    {
        save_resource_url();

        $page->load('sections');

        return $this->view('titan::pages.components.page_components')->with('page', $page);
    }
1295615
protected function _hasPage($model, $page)
    {
        $params = $this->params($model);

        return !empty($params) && $params[$page . 'Page'];
    }
1056929
public function toTrash(Page $page)
    {
        $page->setState(Page::STATE_DELETED);

        if (!$page->isLeaf()) {
            $subquery = $this->getEntityManager()
                    ->getRepository('BackBee\NestedNode\Section')
                    ->createQueryBuilder('n')
                    ->select('n._uid')
                    ->andIsDescendantOf($page->getSection());

            $this->createQueryBuilder('p')
                            ->update()
                            ->set('p._state', Page::STATE_DELETED)
                            ->andWhere('p._section IN ('.$subquery->getDQL().')')
                            ->setParameters($subquery->getParameters())
                            ->getQuery()
                            ->execute();
        }

        return $page;
    }
809403
public function page($page = null) {
			if ($page != null) {
				$this->_page = $page;
				return true;
			}
			else {
				return $this->_page;
			}
		}
805676
public function findFor(HasPageTemplateInterface $page)
    {
        return $this->findOneBy(array('pageId' => $page->getId(), 'pageEntityName' => ClassLookup::getClass($page)));
    }
1108639
public function hasDocument(Document $document)
    {
        $documentCollection = $document->getCollection();
        $documentDatabase = $documentCollection->getDatabase();

        // check connection
        if ($documentDatabase->getClient()->getDsn() !== $this->getDatabase()->getClient()->getDsn()) {
            return false;
        }

        // check database
        if ($documentDatabase->getName() !== $this->getDatabase()->getName()) {
            return false;
        }

        // check collection
        return $documentCollection->getName() == $this->getName();
    }
1331898
public function addPageFilter(Page $page)
    {
        if ($page && !$page->isRoot()) {
            $this->leftJoin('cc._mainnode', 'p')
                    ->leftJoin('p._section', 'sp')
                    ->andWhere('sp._root = :selectedPageRoot')
                    ->andWhere('sp._leftnode >= :selectedPageLeftnode')
                    ->andWhere('sp._rightnode <= :selectedPageRightnode')
                    ->setParameters([
                        'selectedPageRoot' => $page->getSection()->getRoot(),
                        'selectedPageLeftnode' => $page->getLeftnode(),
                        'selectedPageRightnode' => $page->getRightnode(),
                    ]);
        }
    }
151091
public function setPage($page)
  {
    if ($this->isLocked()) {
      return $this->getObj()->setPage($page)->setLocked();
    } else {
      return parent::setPage($page);
    }
  }
1373742
public function index($page)
    {
        if ($page = $this->getPage($page)) {
            if ($page->getVersionObject()) {
                return $page->reindex($this->search, true);
            }
        }

        return false;
    }
270514
public function iShouldBeOnThePage($page)
    {
        $url = $this->generateUrl($this->routeMap[$page]);
        $this->assertSession()->addressEquals($url);
        $this->assertStatusCodeEquals(200);
    }
360082
public function update(PageRequest $request, Page $page)
    {
        try {
            $attributes = $request->all();

            $page->update($attributes);
            return $this->response->message(trans('messages.success.updated', ['Module' => trans('page::page.name')]))
                ->code(204)
                ->status('success')
                ->url(guard_url('page/page/' . $page->getRouteKey()))
                ->redirect();
        } catch (Exception $e) {
            return $this->response->message($e->getMessage())
                ->code(400)
                ->status('error')
                ->url(guard_url('page/page/' . $page->getRouteKey()))
                ->redirect();
        }

    }
83302
protected function substitutePageDocument(Document $pageDocument)
    {
        if (!is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['Indexer']['indexPageSubstitutePageDocument'])) {
            return $pageDocument;
        }

        $indexConfigurationName = $this->getIndexConfigurationNameForCurrentPage();
        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['Indexer']['indexPageSubstitutePageDocument'] as $classReference) {
            $substituteIndexer = GeneralUtility::makeInstance($classReference);

            if (!$substituteIndexer instanceof SubstitutePageIndexer) {
                $message = get_class($substituteIndexer) . ' must implement interface ' . SubstitutePageIndexer::class;
                throw new \UnexpectedValueException($message, 1310491001);
            }

            if ($substituteIndexer instanceof PageFieldMappingIndexer) {
                $substituteIndexer->setPageIndexingConfigurationName($indexConfigurationName);
            }

            $substituteDocument = $substituteIndexer->getPageDocument($pageDocument);
            if (!$substituteDocument instanceof Document) {
                $message = 'The document returned by ' . get_class($substituteIndexer) . ' is not a valid Document object.';
                throw new \UnexpectedValueException($message, 1310490952);
            }
            $pageDocument = $substituteDocument;
        }

        return $pageDocument;
    }