| @@ -43,14 +43,14 @@ | ||
| 43 | 43 | { |
| 44 | 44 | if ($this->userGroups === null) { |
| 45 | 45 | $this->userGroups = []; |
| 46 | 46 | |
| 47 | - $query = "SELECT * FROM {$this->database->getUserGroupTable()}"; | |
| 48 | - $databaseUserGroups = (array) $this->database->getResults($query); | |
| 47 | + $query = "SELECT ID FROM {$this->database->getUserGroupTable()}"; | |
| 48 | + $userGroups = (array) $this->database->getResults($query); | |
| 49 | 49 | |
| 50 | - foreach ($databaseUserGroups as $databaseUserGroup) { | |
| 51 | - $userGroup = $this->userGroupFactory->createUserGroupFromDatabaseRow($databaseUserGroup); | |
| 52 | - $this->userGroups[$userGroup->getId()] = $userGroup; | |
| 50 | + foreach ($userGroups as $userGroup) { | |
| 51 | + $group = $this->userGroupFactory->createUserGroup($userGroup->ID); | |
| 52 | + $this->userGroups[$group->getId()] = $group; | |
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | return $this->userGroups; |
| @@ -145,13 +145,10 @@ | ||
| 145 | 145 | * @return AbstractUserGroup[] |
| 146 | 146 | * @throws UserGroupTypeException |
| 147 | 147 | * @throws Exception |
| 148 | 148 | */ |
| 149 | - public function getUserGroupsForObject( | |
| 150 | - string $objectType, | |
| 151 | - int|string|null $objectId, | |
| 152 | - bool $ignoreDates = false | |
| 153 | - ): array { | |
| 149 | + public function getUserGroupsForObject(string $objectType, int|string $objectId, bool $ignoreDates = false): array | |
| 150 | + { | |
| 154 | 151 | if ($this->objectHandler->isValidObjectType($objectType) === false) { |
| 155 | 152 | return []; |
| 156 | 153 | } |
| 157 | 154 | |
| @@ -251,9 +248,9 @@ | ||
| 251 | 248 | * @throws UserGroupTypeException |
| 252 | 249 | */ |
| 253 | 250 | public function getFilteredUserGroupsForObject( |
| 254 | 251 | string $objectType, |
| 255 | - int|string|null $objectId, | |
| 252 | + int|string $objectId, | |
| 256 | 253 | bool $ignoreDates = false |
| 257 | 254 | ): array { |
| 258 | 255 | $userGroups = $this->getUserGroupsForObject($objectType, $objectId, $ignoreDates); |
| 259 | 256 | $userUserGroups = $this->getUserGroupsForUser() + $this->getDynamicUserGroups(); |