Networking\InitCmsBundle\Controller\FrontendPageController::isSnapshotActive PHP Method

isSnapshotActive() public method

public isSnapshotActive ( Networking\InitCmsBundle\Model\PageSnapshotInterface $page ) : boolean
$page Networking\InitCmsBundle\Model\PageSnapshotInterface
return boolean
    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;
    }