1 | <?php |
||
23 | class UserQueryParamHandler extends BaseObject |
||
24 | { |
||
25 | use OrganizationAttributeTrait, |
||
26 | OrganizationTypeAttributeTrait, |
||
27 | UserTypeAttributeTrait { |
||
28 | setUserType as parentSetUserType; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @var OrganizationAttributesToUserQueryBehavior |
||
33 | */ |
||
34 | private $owner; |
||
35 | |||
36 | /** |
||
37 | * @var string|string[]|null |
||
38 | */ |
||
39 | public $userState; |
||
40 | |||
41 | /** |
||
42 | * @param string|string[]|null $value |
||
43 | * @return UserQuery |
||
44 | */ |
||
45 | public function setUserState($value): UserQuery |
||
50 | |||
51 | /** |
||
52 | * @param string|string[]|null $value |
||
53 | * @return UserQuery |
||
54 | */ |
||
55 | public function userState($value): UserQuery |
||
59 | |||
60 | /** |
||
61 | * @inheritdoc |
||
62 | * @param OrganizationAttributesToUserQueryBehavior $owner |
||
63 | */ |
||
64 | public function __construct(OrganizationAttributesToUserQueryBehavior $owner, array $config = []) |
||
69 | |||
70 | /** |
||
71 | * @inheritdoc |
||
72 | */ |
||
73 | public function setUserType($value): UserQuery |
||
78 | |||
79 | /** |
||
80 | * @param UserQuery $query |
||
81 | * @throws QueryAbortedException |
||
82 | */ |
||
83 | public function applyParams(UserQuery $query) |
||
113 | |||
114 | /************************************************************ |
||
115 | * JOIN TABLES |
||
116 | ************************************************************/ |
||
117 | |||
118 | /** |
||
119 | * @inheritdoc |
||
120 | */ |
||
121 | protected function joinOrganizationUserTable(UserQuery $query) |
||
142 | |||
143 | /** |
||
144 | * @inheritdoc |
||
145 | */ |
||
146 | protected function joinOrganizationUserTypeTable(Query $query) |
||
154 | |||
155 | |||
156 | /************************************************************ |
||
157 | * ORGANIZATION |
||
158 | ************************************************************/ |
||
159 | |||
160 | /** |
||
161 | * @param UserQuery $query |
||
162 | * @param $organization |
||
163 | * |
||
164 | * @throws QueryAbortedException |
||
165 | */ |
||
166 | protected function applyOrganizationParam(UserQuery $query, $organization) |
||
184 | |||
185 | |||
186 | /************************************************************ |
||
187 | * USER TYPE |
||
188 | ************************************************************/ |
||
189 | |||
190 | /** |
||
191 | * @param UserQuery $query |
||
192 | * @param $type |
||
193 | * |
||
194 | * @throws QueryAbortedException |
||
195 | */ |
||
196 | protected function applyUserTypeParam(UserQuery $query, $type) |
||
216 | |||
217 | |||
218 | /************************************************************ |
||
219 | * USER STATE |
||
220 | ************************************************************/ |
||
221 | |||
222 | /** |
||
223 | * @param UserQuery $query |
||
224 | * @param $state |
||
225 | * |
||
226 | * @throws QueryAbortedException |
||
227 | */ |
||
228 | protected function applyUserStateParam(UserQuery $query, $state) |
||
246 | } |
||
247 |
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: