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