shahroq / whale_c5_cheat_sheet

concrete5 Cheat Sheet
MIT License
70 stars 33 forks source link

use getUserGroupObjects() instead of getUserGroups() #8

Closed mnakalay closed 5 years ago

mnakalay commented 5 years ago

Hello,

When getting the groups a user belongs to, you're getting an array of group IDs using getUserGroups() then looping to get all the group objects by ID. You could get them directly by using getUserGroupObjects() instead of getUserGroups()

That function uses a GroupList object and filters it by the User ID so it might be marginally more efficient.

shahroq commented 5 years ago

Makes sense. I updated the code.