<?php
namespace Cms\Modules\CalendarBundle\Entity\Event;
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\CalendarBundle\Model\Event\EventData;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Cms\SyncBundle\Model\Interfaces\Syncable\SyncableInterface;
use Cms\SyncBundle\Model\Interfaces\Syncable\SyncableTrait;
use Cms\ImportBundle\Model\Interfaces\Importable\ImportableInterface;
use Cms\ImportBundle\Model\Interfaces\Importable\ImportableTrait;
/**
* Class EventProxy
* @package Cms\Modules\CalendarBundle\EntityEvent\Event
*
* @property EventData $data
* @property ArrayCollection|EventHistory[] $histories
* @property EventHistory $history
* @property ArrayCollection|EventDraft[] $drafts
*
* @method EventData getData()
* @method ArrayCollection|EventHistory[] getHistories()
* @method EventHistory getHistory()
* @method EventDraft getDraft()
* @method ArrayCollection|EventDraft[] getDrafts()
* @method EventProxy setData(EventData $value)
* @method EventProxy setHistory(EventHistory $value)
*
*
* @ORM\Entity
*/
class EventProxy extends Proxy implements ShareableInterface, SyncableInterface, ImportableInterface
{
const TYPE = 'Event';
const LOCKABLE_TYPE = 'calendar';
use EventDataTrait, ShareableTrait, SyncableTrait, ImportableTrait;
/**
* {@inheritDoc}
*/
public function isJumpable()
{
return (parent::isJumpable() && $this->getData()->getStartDate() <= DateTimeUtils::now());
}
}