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