loadQuery(UserGroupRepositoryQuery::class); } public function getDefaultOptionsSearch(): array { return [ self::WITH => [], self::JOIN_WITH => [], self::ORDER_BY => '', self::ATTRIBUTE_ID_PRODUCER => 'user_group.id_producer' ]; } public function findOneUserGroupById(int $id) { return $this->createDefaultQuery() ->filterById($id) ->findOne(); } public function findOneUserGroupByName(string $name) { return $this->createDefaultQuery() ->filterByName($name) ->findOne(); } public function findUserGroups() { return $this->createDefaultQuery()->find(); } public function populateUserGroupDropdownList(): array { $userGroupsArrayDropdown = ['' => '--']; $userGroupsArray = $this->findUserGroups(); foreach ($userGroupsArray as $userGroup) { $userGroupsArrayDropdown[$userGroup['id']] = $userGroup['name']; } return $userGroupsArrayDropdown; } }