| 1 | <?php |
||
| 11 | class ReferenceEntity |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var int|null |
||
| 15 | * @ORM\Id() |
||
| 16 | * @ORM\Column(type="integer") |
||
| 17 | * @ORM\GeneratedValue(strategy="AUTO") |
||
| 18 | */ |
||
| 19 | private $id; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var MyEntity |
||
| 23 | * @ORM\ManyToOne(targetEntity="MyEntity") |
||
| 24 | */ |
||
| 25 | private $reference; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var ReferenceEntity |
||
| 29 | * @ORM\ManyToOne(targetEntity="ReferenceEntity", inversedBy="children") |
||
| 30 | */ |
||
| 31 | private $parent; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @var ReferenceEntity[]|ArrayCollection |
||
| 35 | * @ORM\OneToMany(targetEntity="ReferenceEntity", mappedBy="parent") |
||
| 36 | */ |
||
| 37 | private $children; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * ReferenceEntity constructor. |
||
| 41 | */ |
||
| 42 | public function __construct() |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @return MyEntity |
||
| 49 | */ |
||
| 50 | public function getReference() |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @param MyEntity $reference |
||
| 57 | */ |
||
| 58 | public function setReference($reference) |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @return ReferenceEntity |
||
| 65 | */ |
||
| 66 | public function getParent() |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @param ReferenceEntity $parent |
||
| 73 | */ |
||
| 74 | public function setParent($parent) |
||
| 78 | |||
| 79 | /** |
||
| 80 | * @return ArrayCollection|ReferenceEntity[] |
||
| 81 | */ |
||
| 82 | public function getChildren() |
||
| 86 | |||
| 87 | /** |
||
| 88 | * @param ArrayCollection|ReferenceEntity[] $children |
||
| 89 | */ |
||
| 90 | public function setChildren($children) |
||
| 94 | |||
| 95 | /** |
||
| 96 | * @return int|null |
||
| 97 | */ |
||
| 98 | public function getId() |
||
| 102 | } |
||
| 103 |