1 | <?php |
||
12 | trait ScopesProviderTrait |
||
13 | { |
||
14 | /** |
||
15 | * @var Collections\Collection |
||
16 | */ |
||
17 | protected $scopes; |
||
18 | |||
19 | /** |
||
20 | * @return array |
||
21 | */ |
||
22 | public function getScopes() |
||
26 | |||
27 | /** |
||
28 | * @return string |
||
29 | */ |
||
30 | public function getScopesString() |
||
34 | |||
35 | /** |
||
36 | * @param Collections\Collection|array $scopes |
||
37 | */ |
||
38 | public function setScopes($scopes) |
||
39 | { |
||
40 | if (! $scopes instanceof Collections\Collection) { |
||
41 | $scopes = new Collections\ArrayCollection($scopes); |
||
42 | } |
||
43 | |||
44 | $this->scopes = $scopes; |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * initializes an empty array collection, required by Doctrine |
||
49 | * call this in the constructor of each class implementing this trait |
||
50 | */ |
||
51 | private function initScopes() |
||
55 | } |
||
56 |