1 | <?php |
||
14 | trait UniqueModelsAwareTrait |
||
15 | { |
||
16 | |||
17 | /** |
||
18 | * Annotated model |
||
19 | * @var AnnotatedInterface[] |
||
20 | */ |
||
21 | private $models = []; |
||
22 | |||
23 | /** |
||
24 | * Annotated models |
||
25 | * @var AnnotatedInterface[] |
||
26 | */ |
||
27 | 3 | public function getModels() |
|
31 | |||
32 | /** |
||
33 | * |
||
34 | * @param AnnotatedInterface[] $models |
||
35 | * @return $this |
||
36 | */ |
||
37 | 4 | public function setModels($models) |
|
45 | |||
46 | /** |
||
47 | * Add model to set but only if it's instance is not present in set. |
||
48 | * |
||
49 | * @param AnnotatedInterface $model |
||
50 | * @return boolean Whether model was added |
||
51 | */ |
||
52 | public function addModel(AnnotatedInterface $model) |
||
61 | |||
62 | /** |
||
63 | * Remove model from set. |
||
64 | * |
||
65 | * @param AnnotatedInterface $model |
||
66 | * @return boolean Whether model was removed |
||
67 | */ |
||
68 | public function removeModel(AnnotatedInterface $model) |
||
86 | |||
87 | public function hasModel(AnnotatedInterface $model) |
||
98 | |||
99 | } |
||
100 |