|
- <?php
-
- namespace common\logic\User\UserGroup;
-
- use common\helpers\GlobalParam;
- use common\logic\BaseService;
- use common\logic\RepositoryInterface;
-
- class UserGroupRepository extends BaseService implements RepositoryInterface
- {
- public function defaultOptionsSearch()
- {
- return [
- 'with' => [],
- 'join_with' => [],
- 'orderby' => '',
- 'attribute_id_producer' => ''
- ];
- }
-
- public function populateDropdownList(): array
- {
- $userGroupsArrayDropdown = ['' => '--'];
- $userGroupsArray = UserGroup::find()->where('id_producer = ' . GlobalParam::getCurrentProducerId())->all();
-
- foreach ($userGroupsArray as $userGroup) {
- $userGroupsArrayDropdown[$userGroup['id']] = $userGroup['name'];
- }
-
- return $userGroupsArrayDropdown;
- }
- }
|