1 | <?php |
||
22 | class UserQueryParamHandler extends BaseObject |
||
23 | { |
||
24 | use OrganizationAttributeTrait, |
||
25 | OrganizationTypeAttributeTrait, |
||
26 | UserTypeAttributeTrait { |
||
27 | setUserType as parentSetUserType; |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * @var OrganizationAttributesToUserQueryBehavior |
||
32 | */ |
||
33 | private $owner; |
||
34 | |||
35 | /** |
||
36 | * @var string|string[]|null |
||
37 | */ |
||
38 | public $userState; |
||
39 | |||
40 | /** |
||
41 | * @param string|string[]|null $value |
||
42 | * @return UserQuery |
||
43 | */ |
||
44 | public function setUserState($value): UserQuery |
||
49 | |||
50 | /** |
||
51 | * @param string|string[]|null $value |
||
52 | * @return UserQuery |
||
53 | */ |
||
54 | public function userState($value): UserQuery |
||
58 | |||
59 | /** |
||
60 | * @inheritdoc |
||
61 | * @param OrganizationAttributesToUserQueryBehavior $owner |
||
62 | */ |
||
63 | public function __construct(OrganizationAttributesToUserQueryBehavior $owner, array $config = []) |
||
68 | |||
69 | /** |
||
70 | * @inheritdoc |
||
71 | */ |
||
72 | public function setUserType($value): UserQuery |
||
77 | |||
78 | /** |
||
79 | * @param UserQuery $query |
||
80 | */ |
||
81 | public function applyParams(UserQuery $query) |
||
111 | |||
112 | /************************************************************ |
||
113 | * JOIN TABLES |
||
114 | ************************************************************/ |
||
115 | |||
116 | /** |
||
117 | * @inheritdoc |
||
118 | */ |
||
119 | protected function joinOrganizationUserTable(UserQuery $query) |
||
140 | |||
141 | /** |
||
142 | * @inheritdoc |
||
143 | */ |
||
144 | protected function joinOrganizationUserTypeTable(Query $query) |
||
152 | |||
153 | |||
154 | /************************************************************ |
||
155 | * ORGANIZATION |
||
156 | ************************************************************/ |
||
157 | |||
158 | /** |
||
159 | * @param UserQuery $query |
||
160 | * @param $organization |
||
161 | */ |
||
162 | protected function applyOrganizationParam(UserQuery $query, $organization) |
||
175 | |||
176 | |||
177 | /************************************************************ |
||
178 | * USER TYPE |
||
179 | ************************************************************/ |
||
180 | |||
181 | /** |
||
182 | * @param UserQuery $query |
||
183 | * @param $type |
||
184 | */ |
||
185 | protected function applyUserTypeParam(UserQuery $query, $type) |
||
201 | |||
202 | |||
203 | /************************************************************ |
||
204 | * USER STATE |
||
205 | ************************************************************/ |
||
206 | |||
207 | /** |
||
208 | * @param UserQuery $query |
||
209 | * @param $state |
||
210 | */ |
||
211 | protected function applyUserStateParam(UserQuery $query, $state) |
||
224 | } |
||
225 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: