src/Cms/Modules/AlertBundle/Entity/Alert/AlertProxy.php line 34

Open in your IDE?
  1. <?php
  2. namespace Cms\Modules\AlertBundle\Entity\Alert;
  3. use Cms\CoreBundle\Util\DateTimeUtils;
  4. use Cms\ModuleBundle\Entity\Proxy;
  5. use Cms\ModuleBundle\Model\Interfaces\Shareable\ShareableInterface;
  6. use Cms\ModuleBundle\Model\Interfaces\Shareable\ShareableTrait;
  7. use Cms\Modules\AlertBundle\Model\Alert\AlertData;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Cms\ImportBundle\Model\Interfaces\Importable\ImportableInterface;
  11. use Cms\ImportBundle\Model\Interfaces\Importable\ImportableTrait;
  12. /**
  13.  * Class AlertProxy
  14.  * @package Cms\Modules\AlertBundle\Entity\Alert
  15.  *
  16.  * @property AlertData $data
  17.  * @property ArrayCollection|AlertHistory[] $histories
  18.  * @property AlertHistory $history
  19.  * @property ArrayCollection|AlertDraft[] $drafts
  20.  *
  21.  * @method AlertData getData()
  22.  * @method ArrayCollection|AlertHistory[] getHistories()
  23.  * @method AlertHistory getHistory()
  24.  * @method AlertDraft getDraft()
  25.  * @method ArrayCollection|AlertDraft[] getDrafts()
  26.  * @method AlertProxy setData(AlertData $value)
  27.  * @method AlertProxy setHistory(AlertHistory $value)
  28.  *
  29.  * @ORM\Entity
  30.  */
  31. class AlertProxy extends Proxy implements ShareableInterfaceImportableInterface
  32. {
  33.     const TYPE 'Alert';
  34.     const LOCKABLE_TYPE 'alert';
  35.     use AlertDataTraitShareableTraitImportableTrait;
  36.     /**
  37.      * {@inheritDoc}
  38.      */
  39.     public function isJumpable()
  40.     {
  41.         return (parent::isJumpable() && empty($this->getData()->getExternalLink()) && $this->getData()->getStartDate() <= DateTimeUtils::now());
  42.     }
  43. }