<?php
namespace Cms\Modules\AlertBundle\Entity\Alert;
use Cms\CoreBundle\Util\DateTimeUtils;
use Cms\ModuleBundle\Entity\Proxy;
use Cms\ModuleBundle\Model\Interfaces\Shareable\ShareableInterface;
use Cms\ModuleBundle\Model\Interfaces\Shareable\ShareableTrait;
use Cms\Modules\AlertBundle\Model\Alert\AlertData;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Cms\ImportBundle\Model\Interfaces\Importable\ImportableInterface;
use Cms\ImportBundle\Model\Interfaces\Importable\ImportableTrait;
/**
* Class AlertProxy
* @package Cms\Modules\AlertBundle\Entity\Alert
*
* @property AlertData $data
* @property ArrayCollection|AlertHistory[] $histories
* @property AlertHistory $history
* @property ArrayCollection|AlertDraft[] $drafts
*
* @method AlertData getData()
* @method ArrayCollection|AlertHistory[] getHistories()
* @method AlertHistory getHistory()
* @method AlertDraft getDraft()
* @method ArrayCollection|AlertDraft[] getDrafts()
* @method AlertProxy setData(AlertData $value)
* @method AlertProxy setHistory(AlertHistory $value)
*
* @ORM\Entity
*/
class AlertProxy extends Proxy implements ShareableInterface, ImportableInterface
{
const TYPE = 'Alert';
const LOCKABLE_TYPE = 'alert';
use AlertDataTrait, ShareableTrait, ImportableTrait;
/**
* {@inheritDoc}
*/
public function isJumpable()
{
return (parent::isJumpable() && empty($this->getData()->getExternalLink()) && $this->getData()->getStartDate() <= DateTimeUtils::now());
}
}