I'm trying to list all groups, what would be a good a quick method? I'm trying to avoid a sql query to table *_groups_entity and use elgg api instead, but I don't find the right function
Thanks in advance
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Cash@costelloc
Cash - 0 likes
- zootrasgo@zootrasgo
zootrasgo - 0 likes
You must log in to post replies.elgg_list_entities() will do it
Thank you very much.
What I want to do is to avoid creating a group with the same name of another previously created. I understand that using elgg_list_entities() will force me to query the name of each entity I get. With lots of groups and lots of group creation request, checking that could lead to a database performance problem (one query to get the entities, and one more query for each entity to get its name and compare). I think what I look for is something with just one query that checks if there is already a group with the same name, and I'm now realizing a direct sql query will be required, more optimun but less elgg-ish
I would appreciate if people here confirm my thoughts are right, or there is something in elgg API that could fit.
Thank you