|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* @copyright Copyright (c) Flipbox Digital Limited |
|
5
|
|
|
* @license https://flipboxfactory.com/software/organization/license |
|
6
|
|
|
* @link https://www.flipboxfactory.com/software/organization/ |
|
7
|
|
|
*/ |
|
8
|
|
|
|
|
9
|
|
|
namespace flipbox\organizations; |
|
10
|
|
|
|
|
11
|
|
|
use Craft; |
|
12
|
|
|
use craft\base\Plugin as BasePlugin; |
|
13
|
|
|
use craft\elements\db\UserQuery; |
|
14
|
|
|
use craft\elements\User; |
|
15
|
|
|
use craft\events\CancelableEvent; |
|
16
|
|
|
use craft\events\DefineBehaviorsEvent; |
|
17
|
|
|
use craft\events\RegisterComponentTypesEvent; |
|
18
|
|
|
use craft\events\RegisterElementSourcesEvent; |
|
19
|
|
|
use craft\events\RegisterUrlRulesEvent; |
|
20
|
|
|
use craft\helpers\UrlHelper; |
|
21
|
|
|
use craft\models\FieldLayout as FieldLayoutModel; |
|
22
|
|
|
use craft\services\Elements; |
|
23
|
|
|
use craft\services\Fields; |
|
24
|
|
|
use craft\web\twig\variables\CraftVariable; |
|
25
|
|
|
use craft\web\UrlManager; |
|
26
|
|
|
use flipbox\ember\modules\LoggerTrait; |
|
27
|
|
|
use flipbox\organizations\db\behaviors\OrganizationAttributesToUserQueryBehavior; |
|
28
|
|
|
use flipbox\organizations\elements\behaviors\UserOrganizationsBehavior; |
|
29
|
|
|
use flipbox\organizations\elements\behaviors\UserTypesBehavior; |
|
30
|
|
|
use flipbox\organizations\elements\Organization as OrganizationElement; |
|
31
|
|
|
use flipbox\organizations\fields\Organization as OrganizationField; |
|
32
|
|
|
use flipbox\organizations\fields\OrganizationType as OrganizationTypeField; |
|
33
|
|
|
use flipbox\organizations\models\Settings as OrganizationSettings; |
|
34
|
|
|
use flipbox\organizations\records\OrganizationType as OrganizationType; |
|
35
|
|
|
use flipbox\organizations\web\twig\variables\Organization as OrganizationVariable; |
|
36
|
|
|
use yii\base\Event; |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* @author Flipbox Factory <[email protected]> |
|
40
|
|
|
* @since 1.0.0 |
|
41
|
|
|
* |
|
42
|
|
|
* @method OrganizationSettings getSettings() |
|
43
|
|
|
* |
|
44
|
|
|
* @property services\Element $element |
|
45
|
|
|
* @property services\Organizations $organizations |
|
46
|
|
|
* @property services\OrganizationTypes $organizationTypes |
|
47
|
|
|
* @property services\OrganizationTypeSettings $organizationTypeSettings |
|
48
|
|
|
* @property services\OrganizationTypeAssociations $organizationTypeAssociations |
|
49
|
|
|
* @property services\OrganizationUsers $organizationUsers |
|
50
|
|
|
* @property services\OrganizationUserAssociations $organizationUserAssociations |
|
51
|
|
|
* @property services\Records $records |
|
52
|
|
|
* @property services\Users $users |
|
53
|
|
|
* @property services\UserOrganizations $userOrganizations |
|
54
|
|
|
* @property services\UserOrganizationAssociations $userOrganizationAssociations |
|
55
|
|
|
* @property services\UserTypes $userTypes |
|
56
|
|
|
* @property services\UserTypeAssociations $userTypeAssociations |
|
57
|
|
|
*/ |
|
58
|
|
|
class Organizations extends BasePlugin |
|
59
|
|
|
{ |
|
60
|
|
|
use LoggerTrait; |
|
61
|
|
|
|
|
62
|
|
|
/** |
|
63
|
|
|
* @inheritdoc |
|
64
|
|
|
*/ |
|
65
|
426 |
|
public function init() |
|
66
|
|
|
{ |
|
67
|
|
|
// Services |
|
68
|
426 |
|
$this->setComponents([ |
|
69
|
426 |
|
'element' => services\Element::class, |
|
70
|
|
|
'organizations' => services\Organizations::class, |
|
71
|
|
|
'organizationTypes' => services\OrganizationTypes::class, |
|
72
|
|
|
'organizationTypeSettings' => services\OrganizationTypeSettings::class, |
|
73
|
|
|
'organizationTypeAssociations' => services\OrganizationTypeAssociations::class, |
|
74
|
|
|
'organizationUsers' => services\OrganizationUsers::class, |
|
75
|
|
|
'organizationUserAssociations' => services\OrganizationUserAssociations::class, |
|
76
|
|
|
'records' => services\Records::class, |
|
77
|
|
|
'users' => services\Users::class, |
|
78
|
|
|
'userOrganizations' => services\UserOrganizations::class, |
|
79
|
|
|
'userOrganizationAssociations' => services\UserOrganizationAssociations::class, |
|
80
|
|
|
'userTypes' => services\UserTypes::class, |
|
81
|
|
|
'userTypeAssociations' => services\UserTypeAssociations::class, |
|
82
|
|
|
]); |
|
83
|
|
|
|
|
84
|
|
|
// Sub-Modules |
|
85
|
426 |
|
$this->setModules([ |
|
86
|
426 |
|
'cp' => cp\Cp::class |
|
87
|
|
|
]); |
|
88
|
|
|
|
|
89
|
426 |
|
parent::init(); |
|
90
|
|
|
|
|
91
|
|
|
// Fields |
|
92
|
426 |
|
Event::on( |
|
93
|
426 |
|
Fields::class, |
|
94
|
426 |
|
Fields::EVENT_REGISTER_FIELD_TYPES, |
|
95
|
142 |
|
function (RegisterComponentTypesEvent $event) { |
|
96
|
|
|
$event->types[] = OrganizationField::class; |
|
97
|
|
|
$event->types[] = OrganizationTypeField::class; |
|
98
|
426 |
|
} |
|
99
|
|
|
); |
|
100
|
|
|
|
|
101
|
|
|
// Elements |
|
102
|
426 |
|
Event::on( |
|
103
|
426 |
|
Elements::class, |
|
104
|
426 |
|
Elements::EVENT_REGISTER_ELEMENT_TYPES, |
|
105
|
142 |
|
function (RegisterComponentTypesEvent $event) { |
|
106
|
|
|
$event->types[] = OrganizationElement::class; |
|
107
|
426 |
|
} |
|
108
|
|
|
); |
|
109
|
|
|
|
|
110
|
|
|
// User Query (attach behavior) |
|
111
|
426 |
|
Event::on( |
|
112
|
426 |
|
UserQuery::class, |
|
113
|
426 |
|
UserQuery::EVENT_DEFINE_BEHAVIORS, |
|
114
|
142 |
|
function (DefineBehaviorsEvent $e) { |
|
115
|
24 |
|
$e->behaviors['organization'] = OrganizationAttributesToUserQueryBehavior::class; |
|
116
|
426 |
|
} |
|
117
|
|
|
); |
|
118
|
|
|
|
|
119
|
|
|
// User Query (prepare) |
|
120
|
426 |
|
Event::on( |
|
121
|
426 |
|
UserQuery::class, |
|
122
|
426 |
|
UserQuery::EVENT_AFTER_PREPARE, |
|
123
|
142 |
|
function (CancelableEvent $e) { |
|
124
|
|
|
/** @var UserQuery $query */ |
|
125
|
|
|
$query = $e->sender; |
|
126
|
|
|
|
|
127
|
|
|
/** @var OrganizationAttributesToUserQueryBehavior $behavior */ |
|
128
|
|
|
if (null !== ($behavior = $query->getBehavior('organization'))) { |
|
129
|
|
|
$behavior->applyOrganizationParams($query); |
|
130
|
|
|
} |
|
131
|
426 |
|
} |
|
132
|
|
|
); |
|
133
|
|
|
|
|
134
|
|
|
// User (attach behavior) |
|
135
|
426 |
|
Event::on( |
|
136
|
426 |
|
User::class, |
|
137
|
426 |
|
User::EVENT_DEFINE_BEHAVIORS, |
|
138
|
142 |
|
function (DefineBehaviorsEvent $e) { |
|
139
|
15 |
|
$e->behaviors['organizations'] = UserOrganizationsBehavior::class; |
|
140
|
15 |
|
$e->behaviors['types'] = UserTypesBehavior::class; |
|
141
|
426 |
|
} |
|
142
|
|
|
); |
|
143
|
|
|
|
|
144
|
|
|
// CP routes |
|
145
|
426 |
|
Event::on( |
|
146
|
426 |
|
UrlManager::class, |
|
147
|
426 |
|
UrlManager::EVENT_REGISTER_CP_URL_RULES, |
|
148
|
426 |
|
[self::class, 'onRegisterCpUrlRules'] |
|
149
|
|
|
); |
|
150
|
|
|
|
|
151
|
|
|
// Twig variables |
|
152
|
426 |
|
Event::on( |
|
153
|
426 |
|
CraftVariable::class, |
|
154
|
426 |
|
CraftVariable::EVENT_INIT, |
|
155
|
142 |
|
function (Event $event) { |
|
156
|
|
|
/** @var CraftVariable $variable */ |
|
157
|
|
|
$variable = $event->sender; |
|
158
|
|
|
$variable->set('organizations', OrganizationVariable::class); |
|
159
|
426 |
|
} |
|
160
|
|
|
); |
|
161
|
|
|
|
|
162
|
|
|
// User Type sources |
|
163
|
426 |
|
Event::on( |
|
164
|
426 |
|
User::class, |
|
165
|
426 |
|
User::EVENT_REGISTER_SOURCES, |
|
166
|
142 |
|
function (RegisterElementSourcesEvent $event) { |
|
167
|
|
|
if ($event->context === 'index') { |
|
168
|
|
|
$event->sources[] = [ |
|
169
|
|
|
'heading' => "Organization Groups" |
|
170
|
|
|
]; |
|
171
|
|
|
|
|
172
|
|
|
$types = static::getInstance()->getUserTypes()->findAll(); |
|
173
|
|
|
foreach ($types as $type) { |
|
174
|
|
|
$event->sources[] = [ |
|
175
|
|
|
'key' => 'type:' . $type->id, |
|
176
|
|
|
'label' => Craft::t('organizations', $type->name), |
|
177
|
|
|
'criteria' => ['organization' => ['userType' => $type->id]], |
|
178
|
|
|
'hasThumbs' => true |
|
179
|
|
|
]; |
|
180
|
|
|
} |
|
181
|
|
|
} |
|
182
|
426 |
|
} |
|
183
|
|
|
); |
|
184
|
|
|
|
|
185
|
|
|
// Show organization in the sidebar? |
|
186
|
426 |
|
$userSidebarTemplate = $this->getSettings()->userSidebarTemplate; |
|
187
|
426 |
|
if (!empty($userSidebarTemplate)) { |
|
188
|
142 |
|
Craft::$app->getView()->hook('cp.users.edit.details', function (&$context) use ($userSidebarTemplate) { |
|
189
|
|
|
return Craft::$app->getView()->renderTemplate( |
|
190
|
|
|
$userSidebarTemplate, |
|
191
|
|
|
['context' => $context] |
|
192
|
|
|
); |
|
193
|
426 |
|
}); |
|
194
|
|
|
} |
|
195
|
426 |
|
} |
|
196
|
|
|
|
|
197
|
|
|
/** |
|
198
|
|
|
* @return string |
|
199
|
|
|
*/ |
|
200
|
3 |
|
protected static function getLogFileName(): string |
|
201
|
|
|
{ |
|
202
|
3 |
|
return 'organizations'; |
|
203
|
|
|
} |
|
204
|
|
|
|
|
205
|
|
|
/******************************************* |
|
206
|
|
|
* NAV |
|
207
|
|
|
*******************************************/ |
|
208
|
|
|
|
|
209
|
|
|
/** |
|
210
|
|
|
* @inheritdoc |
|
211
|
|
|
*/ |
|
212
|
|
|
public function getCpNavItem() |
|
213
|
|
|
{ |
|
214
|
|
|
return array_merge( |
|
215
|
|
|
parent::getCpNavItem(), |
|
216
|
|
|
[ |
|
217
|
|
|
'subnav' => [ |
|
218
|
|
|
'organizations.organizations' => [ |
|
219
|
|
|
'label' => Craft::t('organizations', 'Organizations'), |
|
220
|
|
|
'url' => 'organizations' |
|
221
|
|
|
], |
|
222
|
|
|
'organizations.general' => [ |
|
223
|
|
|
'label' => Craft::t('organizations', 'Settings'), |
|
224
|
|
|
'url' => 'organizations/settings' |
|
225
|
|
|
], |
|
226
|
|
|
'organizations.organization-types' => [ |
|
227
|
|
|
'label' => Craft::t('organizations', 'Organization Types'), |
|
228
|
|
|
'url' => 'organizations/settings/organization-types', |
|
229
|
|
|
], |
|
230
|
|
|
'organizations.user-types' => [ |
|
231
|
|
|
'label' => Craft::t('organizations', 'User Types'), |
|
232
|
|
|
'url' => 'organizations/settings/user-types', |
|
233
|
|
|
] |
|
234
|
|
|
] |
|
235
|
|
|
] |
|
236
|
|
|
); |
|
237
|
|
|
} |
|
238
|
|
|
|
|
239
|
|
|
/******************************************* |
|
240
|
|
|
* EVENTS |
|
241
|
|
|
*******************************************/ |
|
242
|
|
|
|
|
243
|
|
|
/** |
|
244
|
|
|
* @param RegisterUrlRulesEvent $event |
|
245
|
|
|
*/ |
|
246
|
|
|
public static function onRegisterCpUrlRules(RegisterUrlRulesEvent $event) |
|
247
|
|
|
{ |
|
248
|
|
|
$event->rules = array_merge( |
|
249
|
|
|
$event->rules, |
|
250
|
|
|
[ |
|
251
|
|
|
// SETTINGS |
|
252
|
|
|
'organizations/settings' => 'organizations/cp/settings/view/general/index', |
|
253
|
|
|
|
|
254
|
|
|
// SETTINGS: USER TYPES |
|
255
|
|
|
'organizations/settings/user-types' => 'organizations/cp/settings/view/user-types/index', |
|
256
|
|
|
'organizations/settings/user-types/new' => |
|
257
|
|
|
'organizations/cp/settings/view/user-types/upsert', |
|
258
|
|
|
'organizations/settings/user-types/<identifier:\d+>' => |
|
259
|
|
|
'organizations/cp/settings/view/user-types/upsert', |
|
260
|
|
|
|
|
261
|
|
|
// SETTINGS: ORGANIZATION TYPES |
|
262
|
|
|
'organizations/settings/organization-types' => |
|
263
|
|
|
'organizations/cp/settings/view/organization-types/index', |
|
264
|
|
|
'organizations/settings/organization-types/new' => |
|
265
|
|
|
'organizations/cp/settings/view/organization-types/upsert', |
|
266
|
|
|
'organizations/settings/organization-types/<identifier:\d+>' => |
|
267
|
|
|
'organizations/cp/settings/view/organization-types/upsert', |
|
268
|
|
|
|
|
269
|
|
|
|
|
270
|
|
|
// ORGANIZATION |
|
271
|
|
|
'organizations' => 'organizations/cp/view/organizations/index', |
|
272
|
|
|
'organizations/new/<typeIdentifier:{handle}>' => 'organizations/cp/view/organizations/upsert', |
|
273
|
|
|
'organizations/new' => 'organizations/cp/view/organizations/upsert', |
|
274
|
|
|
'organizations/<identifier:\d+>' => 'organizations/cp/view/organizations/upsert', |
|
275
|
|
|
'organizations/<identifier:\d+>/<typeIdentifier:{handle}>' => |
|
276
|
|
|
'organizations/cp/view/organizations/upsert' |
|
277
|
|
|
|
|
278
|
|
|
] |
|
279
|
|
|
); |
|
280
|
|
|
} |
|
281
|
|
|
|
|
282
|
|
|
|
|
283
|
|
|
/******************************************* |
|
284
|
|
|
* SETTINGS |
|
285
|
|
|
*******************************************/ |
|
286
|
|
|
|
|
287
|
|
|
/** |
|
288
|
|
|
* @inheritdoc |
|
289
|
|
|
* @return OrganizationSettings |
|
290
|
|
|
*/ |
|
291
|
426 |
|
protected function createSettingsModel() |
|
292
|
|
|
{ |
|
293
|
426 |
|
return new OrganizationSettings(); |
|
294
|
|
|
} |
|
295
|
|
|
|
|
296
|
|
|
/** |
|
297
|
|
|
* @inheritdoc |
|
298
|
|
|
*/ |
|
299
|
|
|
public function getSettingsResponse() |
|
300
|
|
|
{ |
|
301
|
|
|
|
|
302
|
|
|
Craft::$app->getResponse()->redirect( |
|
303
|
|
|
UrlHelper::cpUrl('organizations/settings') |
|
304
|
|
|
); |
|
305
|
|
|
|
|
306
|
|
|
Craft::$app->end(); |
|
307
|
|
|
} |
|
308
|
|
|
|
|
309
|
|
|
|
|
310
|
|
|
/******************************************* |
|
311
|
|
|
* INSTALL / UNINSTALL |
|
312
|
|
|
*******************************************/ |
|
313
|
|
|
|
|
314
|
|
|
/** |
|
315
|
|
|
* Delete any existing field layouts, and create default settings |
|
316
|
|
|
*/ |
|
317
|
|
|
public function afterInstall() |
|
318
|
|
|
{ |
|
319
|
|
|
// Create default field layout |
|
320
|
|
|
$fieldLayout = new FieldLayoutModel(); |
|
321
|
|
|
$fieldLayout->type = self::class; |
|
322
|
|
|
|
|
323
|
|
|
// Delete existing layouts |
|
324
|
|
|
Craft::$app->getFields()->deleteLayoutsByType(self::class); |
|
325
|
|
|
Craft::$app->getFields()->deleteLayoutsByType(OrganizationType::class); |
|
326
|
|
|
Craft::$app->getFields()->deleteLayoutsByType(OrganizationElement::class); |
|
327
|
|
|
|
|
328
|
|
|
// Save layout |
|
329
|
|
|
Craft::$app->getFields()->saveLayout($fieldLayout); |
|
330
|
|
|
|
|
331
|
|
|
// Set settings array |
|
332
|
|
|
$settings = [ |
|
333
|
|
|
'fieldLayoutId' => $fieldLayout->id |
|
334
|
|
|
]; |
|
335
|
|
|
|
|
336
|
|
|
Craft::$app->getPlugins()->savePluginSettings( |
|
337
|
|
|
$this, |
|
338
|
|
|
$settings |
|
339
|
|
|
); |
|
340
|
|
|
|
|
341
|
|
|
// Do parent |
|
342
|
|
|
parent::afterInstall(); |
|
343
|
|
|
} |
|
344
|
|
|
|
|
345
|
|
|
/** |
|
346
|
|
|
* Remove all field layouts |
|
347
|
|
|
*/ |
|
348
|
|
|
public function afterUninstall() |
|
349
|
|
|
{ |
|
350
|
|
|
Craft::$app->getFields()->deleteLayoutsByType(self::class); |
|
351
|
|
|
Craft::$app->getFields()->deleteLayoutsByType(OrganizationType::class); |
|
352
|
|
|
Craft::$app->getFields()->deleteLayoutsByType(OrganizationElement::class); |
|
353
|
|
|
|
|
354
|
|
|
// Do parent |
|
355
|
|
|
parent::afterUninstall(); |
|
356
|
|
|
} |
|
357
|
|
|
|
|
358
|
|
|
/******************************************* |
|
359
|
|
|
* MODULES |
|
360
|
|
|
*******************************************/ |
|
361
|
|
|
/** |
|
362
|
|
|
* @return cp\Cp |
|
363
|
|
|
* @deprecated |
|
364
|
|
|
*/ |
|
365
|
|
|
public function getConfiguration() |
|
366
|
|
|
{ |
|
367
|
|
|
return $this->getCp(); |
|
368
|
|
|
} |
|
369
|
|
|
|
|
370
|
|
|
/** |
|
371
|
|
|
* @return cp\Cp |
|
372
|
|
|
*/ |
|
373
|
|
|
public function getCp() |
|
374
|
|
|
{ |
|
375
|
|
|
return $this->getModule('cp'); |
|
376
|
|
|
} |
|
377
|
|
|
|
|
378
|
|
|
|
|
379
|
|
|
/******************************************* |
|
380
|
|
|
* SERVICES |
|
381
|
|
|
*******************************************/ |
|
382
|
|
|
|
|
383
|
|
|
/** |
|
384
|
|
|
* @noinspection PhpDocMissingThrowsInspection |
|
385
|
|
|
* @return services\Element |
|
386
|
|
|
*/ |
|
387
|
69 |
|
public function getElement(): services\Element |
|
388
|
|
|
{ |
|
389
|
|
|
/** @noinspection PhpUnhandledExceptionInspection */ |
|
390
|
|
|
/** @noinspection PhpIncompatibleReturnTypeInspection */ |
|
391
|
69 |
|
return $this->get('element'); |
|
392
|
|
|
} |
|
393
|
|
|
|
|
394
|
|
|
/** |
|
395
|
|
|
* @noinspection PhpDocMissingThrowsInspection |
|
396
|
|
|
* @return services\Organizations |
|
397
|
|
|
*/ |
|
398
|
36 |
|
public function getOrganizations(): services\Organizations |
|
399
|
|
|
{ |
|
400
|
|
|
/** @noinspection PhpUnhandledExceptionInspection */ |
|
401
|
|
|
/** @noinspection PhpIncompatibleReturnTypeInspection */ |
|
402
|
36 |
|
return $this->get('organizations'); |
|
403
|
|
|
} |
|
404
|
|
|
|
|
405
|
|
|
/** |
|
406
|
|
|
* @noinspection PhpDocMissingThrowsInspection |
|
407
|
|
|
* @return services\OrganizationTypes |
|
408
|
|
|
*/ |
|
409
|
60 |
|
public function getOrganizationTypes(): services\OrganizationTypes |
|
410
|
|
|
{ |
|
411
|
|
|
/** @noinspection PhpUnhandledExceptionInspection */ |
|
412
|
|
|
/** @noinspection PhpIncompatibleReturnTypeInspection */ |
|
413
|
60 |
|
return $this->get('organizationTypes'); |
|
414
|
|
|
} |
|
415
|
|
|
|
|
416
|
|
|
/** |
|
417
|
|
|
* @noinspection PhpDocMissingThrowsInspection |
|
418
|
|
|
* @return services\OrganizationTypeSettings |
|
419
|
|
|
*/ |
|
420
|
21 |
|
public function getOrganizationTypeSettings(): services\OrganizationTypeSettings |
|
421
|
|
|
{ |
|
422
|
|
|
/** @noinspection PhpUnhandledExceptionInspection */ |
|
423
|
|
|
/** @noinspection PhpIncompatibleReturnTypeInspection */ |
|
424
|
21 |
|
return $this->get('organizationTypeSettings'); |
|
425
|
|
|
} |
|
426
|
|
|
|
|
427
|
|
|
/** |
|
428
|
|
|
* @noinspection PhpDocMissingThrowsInspection |
|
429
|
|
|
* @return services\OrganizationTypeAssociations |
|
430
|
|
|
*/ |
|
431
|
33 |
|
public function getOrganizationTypeAssociations(): services\OrganizationTypeAssociations |
|
432
|
|
|
{ |
|
433
|
|
|
/** @noinspection PhpUnhandledExceptionInspection */ |
|
434
|
|
|
/** @noinspection PhpIncompatibleReturnTypeInspection */ |
|
435
|
33 |
|
return $this->get('organizationTypeAssociations'); |
|
436
|
|
|
} |
|
437
|
|
|
|
|
438
|
|
|
/** |
|
439
|
|
|
* @noinspection PhpDocMissingThrowsInspection |
|
440
|
|
|
* @return services\OrganizationUserAssociations |
|
441
|
|
|
*/ |
|
442
|
33 |
|
public function getOrganizationUserAssociations(): services\OrganizationUserAssociations |
|
443
|
|
|
{ |
|
444
|
|
|
/** @noinspection PhpUnhandledExceptionInspection */ |
|
445
|
|
|
/** @noinspection PhpIncompatibleReturnTypeInspection */ |
|
446
|
33 |
|
return $this->get('organizationUserAssociations'); |
|
447
|
|
|
} |
|
448
|
|
|
|
|
449
|
|
|
/** |
|
450
|
|
|
* @noinspection PhpDocMissingThrowsInspection |
|
451
|
|
|
* @return services\OrganizationUsers |
|
452
|
|
|
*/ |
|
453
|
27 |
|
public function getOrganizationUsers(): services\OrganizationUsers |
|
454
|
|
|
{ |
|
455
|
|
|
/** @noinspection PhpUnhandledExceptionInspection */ |
|
456
|
|
|
/** @noinspection PhpIncompatibleReturnTypeInspection */ |
|
457
|
27 |
|
return $this->get('organizationUsers'); |
|
458
|
|
|
} |
|
459
|
|
|
|
|
460
|
|
|
/** |
|
461
|
|
|
* @noinspection PhpDocMissingThrowsInspection |
|
462
|
|
|
* @return services\Records |
|
463
|
|
|
*/ |
|
464
|
15 |
|
public function getRecords(): services\Records |
|
465
|
|
|
{ |
|
466
|
|
|
/** @noinspection PhpUnhandledExceptionInspection */ |
|
467
|
|
|
/** @noinspection PhpIncompatibleReturnTypeInspection */ |
|
468
|
15 |
|
return $this->get('records'); |
|
469
|
|
|
} |
|
470
|
|
|
|
|
471
|
|
|
/** |
|
472
|
|
|
* @noinspection PhpDocMissingThrowsInspection |
|
473
|
|
|
* @return services\Users |
|
474
|
|
|
*/ |
|
475
|
33 |
|
public function getUsers(): services\Users |
|
476
|
|
|
{ |
|
477
|
|
|
/** @noinspection PhpUnhandledExceptionInspection */ |
|
478
|
|
|
/** @noinspection PhpIncompatibleReturnTypeInspection */ |
|
479
|
33 |
|
return $this->get('users'); |
|
480
|
|
|
} |
|
481
|
|
|
|
|
482
|
|
|
/** |
|
483
|
|
|
* @noinspection PhpDocMissingThrowsInspection |
|
484
|
|
|
* @return services\UserOrganizations |
|
485
|
|
|
*/ |
|
486
|
27 |
|
public function getUserOrganizations(): services\UserOrganizations |
|
487
|
|
|
{ |
|
488
|
|
|
/** @noinspection PhpUnhandledExceptionInspection */ |
|
489
|
|
|
/** @noinspection PhpIncompatibleReturnTypeInspection */ |
|
490
|
27 |
|
return $this->get('userOrganizations'); |
|
491
|
|
|
} |
|
492
|
|
|
|
|
493
|
|
|
/** |
|
494
|
|
|
* @noinspection PhpDocMissingThrowsInspection |
|
495
|
|
|
* @return services\UserOrganizationAssociations |
|
496
|
|
|
*/ |
|
497
|
33 |
|
public function getUserOrganizationAssociations(): services\UserOrganizationAssociations |
|
498
|
|
|
{ |
|
499
|
|
|
/** @noinspection PhpUnhandledExceptionInspection */ |
|
500
|
|
|
/** @noinspection PhpIncompatibleReturnTypeInspection */ |
|
501
|
33 |
|
return $this->get('userOrganizationAssociations'); |
|
502
|
|
|
} |
|
503
|
|
|
|
|
504
|
|
|
/** |
|
505
|
|
|
* @noinspection PhpDocMissingThrowsInspection |
|
506
|
|
|
* @return services\UserTypes |
|
507
|
|
|
*/ |
|
508
|
30 |
|
public function getUserTypes(): services\UserTypes |
|
509
|
|
|
{ |
|
510
|
|
|
/** @noinspection PhpUnhandledExceptionInspection */ |
|
511
|
|
|
/** @noinspection PhpIncompatibleReturnTypeInspection */ |
|
512
|
30 |
|
return $this->get('userTypes'); |
|
513
|
|
|
} |
|
514
|
|
|
|
|
515
|
|
|
/** |
|
516
|
|
|
* @noinspection PhpDocMissingThrowsInspection |
|
517
|
|
|
* @return services\UserTypeAssociations |
|
518
|
|
|
*/ |
|
519
|
27 |
|
public function getUserTypeAssociations(): services\UserTypeAssociations |
|
520
|
|
|
{ |
|
521
|
|
|
/** @noinspection PhpUnhandledExceptionInspection */ |
|
522
|
|
|
/** @noinspection PhpIncompatibleReturnTypeInspection */ |
|
523
|
27 |
|
return $this->get('userTypeAssociations'); |
|
524
|
|
|
} |
|
525
|
|
|
} |
|
526
|
|
|
|