1 | <?php |
||
2 | |||
3 | namespace ByTIC\Models\SmartProperties\Definitions\Definition; |
||
4 | |||
5 | /** |
||
6 | * Trait HasPlaces |
||
7 | * @package ByTIC\Models\SmartProperties\Definitions\Traits |
||
8 | */ |
||
9 | trait HasPlaces |
||
10 | { |
||
11 | protected $places = []; |
||
12 | |||
13 | /** |
||
14 | * @return array |
||
15 | */ |
||
16 | public function getPlaces(): array |
||
17 | { |
||
18 | $this->checkBuild(); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
19 | return $this->places; |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * @param array $places |
||
24 | */ |
||
25 | public function setPlaces(array $places): void |
||
26 | { |
||
27 | $this->places = $places; |
||
28 | } |
||
29 | |||
30 | public function addPlace() |
||
31 | { |
||
32 | $this->places = array_unique(array_merge($this->places, func_get_args())); |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @return array |
||
37 | * @deprecated use getPlaces |
||
38 | */ |
||
39 | public function getItemsNames() |
||
40 | { |
||
41 | return $this->getPlaces(); |
||
42 | } |
||
43 | } |
||
44 |