PluginProbe
User Access Manager / 2.3.2
User Access Manager v2.3.2
2.3.20 2.3.19 2.3.18 2.3.17 2.3.16 2.3.15 2.3.14 2.3.13 trunk 0.6 0.6.1 0.6.2 0.7 0.7 Beta 0.7.0.1 0.8 0.8.0.1 0.8.0.2 0.9 0.9.1 0.9.1.1 0.9.1.2 0.9.1.3 0.9.1.4 1.0 All 136 releases
← All changes | src/UserGroup/UserGroupHandler.php +8 -11 2.3.172.3.2 View file →
@@ -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();