<?php
namespace Cms\WorkflowsBundle\Entity\Content;
use Cms\ModuleBundle\Entity\Draft;
use Cms\Modules\CalendarBundle\Entity\Event\EventDraft;
use Cms\WorkflowsBundle\Entity\WorkflowContent;
use Doctrine\ORM\Mapping as ORM;
/**
* Class CalendarContent
* @package Cms\WorkflowsBundle\Entity\Content
*
* @ORM\Entity(
* repositoryClass = "Cms\WorkflowsBundle\Doctrine\Content\CalendarContentRepository"
* )
*/
class CalendarContent extends WorkflowContent
{
protected $contentType = WorkflowContent::CONTENT_TYPES__CALENDAR;
/**
* @var EventDraft
*
* @ORM\OneToOne(
* targetEntity = "Cms\Modules\CalendarBundle\Entity\Event\EventDraft"
* )
* @ORM\JoinColumn(
* name = "draftCalendar",
* referencedColumnName = "id",
* onDelete = "CASCADE"
* )
*/
protected $draft;
/**
* {@inheritdoc}
* @param EventDraft $value
*/
public function setDraft(Draft $value)
{
if ( ! $value instanceof EventDraft) {
throw new \Exception();
}
$this->draft = $value;
return $this;
}
/**
* {@inheritdoc}
* @return EventDraft
*/
public function getDraft()
{
return $this->draft;
}
}