1 | <?php |
||
7 | class MyEntity |
||
8 | { |
||
9 | /** |
||
10 | * @var int|null |
||
11 | */ |
||
12 | private $id; |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private $publicApiField = 'defaults'; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $privateField; |
||
23 | |||
24 | /** |
||
25 | * @var MyEntity |
||
26 | */ |
||
27 | private $parent; |
||
28 | /** |
||
29 | * @var ArrayCollection|MyEntity[] |
||
30 | */ |
||
31 | private $children; |
||
32 | |||
33 | /** |
||
34 | * MyEntity constructor. |
||
35 | * |
||
36 | * @param string $privateField |
||
37 | */ |
||
38 | public function __construct($privateField = 'test') |
||
43 | |||
44 | /** |
||
45 | * @return MyEntity |
||
46 | */ |
||
47 | public function getParent() |
||
51 | |||
52 | /** |
||
53 | * @param MyEntity $parent |
||
54 | */ |
||
55 | public function setParent(MyEntity $parent = null) |
||
67 | |||
68 | /** |
||
69 | * @return string |
||
70 | */ |
||
71 | public function getPublicApiField() |
||
75 | |||
76 | /** |
||
77 | * @param string $publicApiField |
||
78 | */ |
||
79 | public function setPublicApiField($publicApiField) |
||
83 | |||
84 | /** |
||
85 | * @return mixed |
||
86 | */ |
||
87 | public function getId() |
||
91 | |||
92 | /** |
||
93 | * @return MyEntity[] |
||
94 | */ |
||
95 | public function getChildren() |
||
99 | |||
100 | public function addChild(MyEntity $entity) |
||
106 | |||
107 | public function removeChild(MyEntity $entity) |
||
113 | } |
||
114 |