Skip to content

Instantly share code, notes, and snippets.

@prendit
Created January 3, 2014 13:03
Show Gist options
  • Save prendit/8237555 to your computer and use it in GitHub Desktop.
Save prendit/8237555 to your computer and use it in GitHub Desktop.
/**
* @ORM\Entity
* @ORM\Table(name="eav_content_type")
* @Annotation\Name("eav_content_type")
* @Annotation\Object("PrenditCms\Core\Eav\Entity\EavContentType")
*/
class EavContentType
{
/**
* @var int $id
*
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
* @Annotation\Type("hidden")
* @Annotation\Required(false)
*/
protected $id;
/**
* @var ArrayCollection $attributes
*
* @ORM\OneToMany(targetEntity="PrenditCms\Core\Eav\Entity\EavAttribute", mappedBy="contentType", cascade={"persist"})
* @Annotation\ComposedObject({
* "target_object" : "PrenditCms\Core\Eav\Entity\EavAttribute",
* "is_collection" : true,
* "options" : {
* "label" : "Attributes",
* "allow_add" : true,
* "allow_remove" : true,
* "should_create_template" : true
* }
* })
*/
protected $attributes;
}
/**
* @ORM\Entity
* @ORM\Table(name="eav_attribute")
* @Annotation\Name("eav_attribute")
* @Annotation\Object("PrenditCms\Core\Eav\Entity\EavAttribute")
*/
class EavAttribute
{
/**
* @var int $id
*
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
* @Annotation\Type("hidden")
* @Annotation\Required(false)
*/
protected $id;
/**
* @var ArrayCollection $collection
*
* @ORM\OneToMany(targetEntity="PrenditCms\Core\Eav\Entity\EavAttributeCollection", mappedBy="attribute", cascade={"persist"})
* @Annotation\ComposedObject({
* "target_object" : "PrenditCms\Core\Eav\Entity\EavAttributeCollection",
* "is_collection" : true,
* "options" : {
* "label" : "Values",
* "allow_add" : true,
* "allow_remove" : true,
* "should_create_template" : true
* }
* })
* @Annotation\Required(false)
*/
protected $collection;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment