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