-
-
Save doctrinebot/125e146e07f067cf1614 to your computer and use it in GitHub Desktop.
Attachments to Doctrine Jira Issue DDC-1161 - https://github.com/doctrine/doctrine2/issues/1763
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace NCMS\Common\ContentBundle\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
use Symfony\Component\Validator\Constraints as Assert; | |
/** | |
* @ORM\Entity | |
* @ORM\Table(name="content") | |
* @ORM\InheritanceType("JOINED") | |
* @ORM\DiscriminatorColumn(name="class", type="string") | |
* @ORM\DiscriminatorMap({ | |
"Page" = "NCMS\ContentType\PageBundle\Entity\Page", | |
"Article" = "NCMS\ContentType\ArticleBundle\Entity\Article", | |
}) | |
*/ | |
class Content { | |
/** @ORM\Id | |
* @ORM\Column(type="integer") | |
* @ORM\GeneratedValue | |
*/ | |
protected $id; | |
/** @ORM\Column(type="text") | |
* @Assert\NotBlank() | |
*/ | |
protected $name; | |
/** @ORM\Column(type="integer") | |
* @Assert\NotBlank() | |
*/ | |
protected $status; | |
/** | |
* @ORM\OneToOne(targetEntity="Content",cascade={"none"}) | |
*/ | |
protected $parent; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace NCMS\ContentType\PageBundle\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
use Symfony\Component\Validator\Constraints as Assert; | |
/** | |
* @ORM\Entity | |
* @ORM\Table(name="page") | |
*/ | |
class Page extends Content | |
{ | |
/** @ORM\Column(type="text") */ | |
protected $meta; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment