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