1 | <?php |
||
30 | class FamilyLog |
||
31 | { |
||
32 | /** |
||
33 | * @var int Logistic family id |
||
34 | * |
||
35 | * @ORM\Column(name="id", type="integer") |
||
36 | * @ORM\Id |
||
37 | * @ORM\GeneratedValue(strategy="AUTO") |
||
38 | */ |
||
39 | private $id; |
||
40 | |||
41 | /** |
||
42 | * @Gedmo\TreePath |
||
43 | * @ORM\Column(length=3000, nullable=true) |
||
44 | */ |
||
45 | private $path; |
||
46 | |||
47 | /** |
||
48 | * @Gedmo\TreePathSource |
||
49 | * @var string Logistic family name |
||
50 | * |
||
51 | * @ORM\Column(name="name", type="string", length=255) |
||
52 | */ |
||
53 | private $name; |
||
54 | |||
55 | /** |
||
56 | * @var string Slug name |
||
57 | * @Gedmo\Slug(fields={"name"}) |
||
58 | * @ORM\Column(length=128, unique=true) |
||
59 | */ |
||
60 | private $slug; |
||
61 | |||
62 | /** |
||
63 | * @Gedmo\TreeParent |
||
64 | * @ORM\ManyToOne(targetEntity="App\Entity\Settings\Diverse\FamilyLog", inversedBy="children") |
||
65 | * @ORM\JoinColumn(referencedColumnName="id", onDelete="CASCADE") |
||
66 | */ |
||
67 | private $parent; |
||
68 | |||
69 | /** |
||
70 | * @Gedmo\TreeLevel |
||
71 | * @ORM\Column(type="integer", nullable=true) |
||
72 | */ |
||
73 | private $level; |
||
74 | |||
75 | /** |
||
76 | * @ORM\OneToMany(targetEntity="App\Entity\Settings\Diverse\FamilyLog", mappedBy="parent") |
||
77 | */ |
||
78 | private $children; |
||
79 | |||
80 | |||
81 | /** |
||
82 | * Get id. |
||
83 | * |
||
84 | * @return int |
||
85 | */ |
||
86 | public function getId() |
||
90 | |||
91 | /** |
||
92 | * Set name. |
||
93 | * |
||
94 | * @param string $name Designation |
||
95 | * |
||
96 | * @return FamilyLog |
||
97 | */ |
||
98 | public function setName($name) |
||
104 | |||
105 | /** |
||
106 | * Get name. |
||
107 | * |
||
108 | * @return string |
||
109 | */ |
||
110 | public function getName() |
||
114 | |||
115 | /** |
||
116 | * This method allows to do "echo $familyLog". |
||
117 | * <p> So, to "show" $familyLog, |
||
118 | * PHP will actually show the return of this method.<br /> |
||
119 | * Here, the name, so "echo $ familyLog" |
||
120 | * is equivalent to "echo $familyLog->getName ()"</p>. |
||
121 | * |
||
122 | * @return string name |
||
123 | */ |
||
124 | public function __toString() |
||
128 | |||
129 | /** |
||
130 | * Get slug |
||
131 | * |
||
132 | * @return string |
||
133 | */ |
||
134 | public function getSlug() |
||
138 | |||
139 | /** |
||
140 | * Set parent |
||
141 | * |
||
142 | * @param null|\App\Entity\Settings\Diverse\FamilyLog $parent |
||
143 | * @return FamilyLog |
||
144 | */ |
||
145 | public function setParent(\App\Entity\Settings\Diverse\FamilyLog $parent = null) |
||
151 | |||
152 | /** |
||
153 | * Get parent |
||
154 | * |
||
155 | * @return \App\Entity\Settings\Diverse\FamilyLog|null |
||
156 | */ |
||
157 | public function getParent() |
||
161 | |||
162 | /** |
||
163 | * Add children |
||
164 | * |
||
165 | * @param \App\Entity\Settings\Diverse\FamilyLog $children |
||
166 | * @return FamilyLog |
||
167 | */ |
||
168 | public function addChild(\App\Entity\Settings\Diverse\FamilyLog $children) |
||
174 | |||
175 | /** |
||
176 | * Remove children |
||
177 | * |
||
178 | * @param \App\Entity\Settings\Diverse\FamilyLog $children |
||
179 | */ |
||
180 | public function removeChild(\App\Entity\Settings\Diverse\FamilyLog $children) |
||
184 | |||
185 | /** |
||
186 | * Get children |
||
187 | * |
||
188 | * @return \App\Entity\Settings\Diverse\FamilyLog[]|\Doctrine\Common\Collections\ArrayCollection |
||
189 | */ |
||
190 | public function getChildren() |
||
194 | /** |
||
195 | * Constructor |
||
196 | */ |
||
197 | public function __construct() |
||
201 | |||
202 | /** |
||
203 | * Set path |
||
204 | * |
||
205 | * @param string $path |
||
206 | * @return \App\Entity\Settings\Diverse\FamilyLog |
||
207 | */ |
||
208 | public function setPath($path) |
||
214 | |||
215 | /** |
||
216 | * Get path |
||
217 | * |
||
218 | * @return string |
||
219 | */ |
||
220 | public function getPath() |
||
224 | |||
225 | /** |
||
226 | * Set level |
||
227 | * |
||
228 | * @param integer $level |
||
229 | * @return \App\Entity\Settings\Diverse\FamilyLog |
||
230 | */ |
||
231 | public function setLevel($level) |
||
237 | |||
238 | /** |
||
239 | * Get level |
||
240 | * |
||
241 | * @return integer |
||
242 | */ |
||
243 | public function getLevel() |
||
247 | |||
248 | /** |
||
249 | * Allows hierachy display. |
||
250 | * |
||
251 | * @return string |
||
252 | */ |
||
253 | public function getIndentedName() |
||
263 | } |
||
264 |