Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Entities;
- /**
- * @Entity
- * @Table(name="groups")
- */
- class Group
- {
- /**
- * @Id
- * @Column(type="integer")
- * @GeneratedValue(strategy="AUTO")
- */
- public $id;
- /**
- * @OneToMany(targetEntity="Entities\Group", mappedBy="parent", cascade={"persist", "detach"})
- */
- public $children;
- /**
- * @ManyToOne(targetEntity="Entities\Group", inversedBy="children")
- * @JoinColumn(name="parentId", referencedColumnName="id")
- */
- public $parent;
- public function __construct()
- {
- $this->children = new \Doctrine\Common\Collections\ArrayCollection;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement