Total Complexity | 5 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | trait ScopeTrait |
||
24 | { |
||
25 | /** @var null|ScopeInterface */ |
||
26 | protected $scope; |
||
27 | |||
28 | public function getScope(): ?ScopeInterface |
||
29 | { |
||
30 | return $this->scope; |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * Associate scope with the selector. |
||
35 | * @param ScopeInterface|null $scope |
||
36 | */ |
||
37 | public function setScope(?ScopeInterface $scope): void |
||
38 | { |
||
39 | $this->scope = $scope; |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * @deprecated Use {@see setScope()} instead. |
||
44 | * @param ConstrainInterface|null $constrain |
||
45 | * @return AbstractLoader|$this |
||
46 | */ |
||
47 | public function setConstrain(?ConstrainInterface $constrain = null): self |
||
48 | { |
||
49 | $this->setScope($constrain); |
||
50 | |||
51 | return $this; |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * @param SelectQuery $query |
||
56 | * @return SelectQuery |
||
57 | */ |
||
58 | protected function applyScope(SelectQuery $query): SelectQuery |
||
65 | } |
||
66 | } |
||
67 |