zootrasgo

Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

Activity

  • zootrasgo replied on the discussion topic SimpleQuery
    Thank you for your feedback. Yes I can do it with the existing API, but not efficencly. Before creating a new group I want to check another group with the same name already exists. It if does do something (not an error) and if it does then create... view reply
  • zootrasgo replied on the discussion topic SimpleQuery
    Thank you Cash It is still in 1.7 I'm using. Is there any fast alternative for 1.8? will query still be available? Thank you for your support view reply
  • zootrasgo added a new discussion topic SimpleQuery in the group Plugin Development
    I'm trying to user simplequery() but it seems I need to include something before. It gives me an error when a create the object ($query  = new SimpleQuery();) Thank you!
    • Thank you for your feedback. Yes I can do it with the existing API, but not efficencly.

      Before creating a new group I want to check another group with the same name already exists. It if does do something (not an error) and if it does then create it.

      I can query the guid of the groups and then query the name of each guid, it is fine, but with "zillions" of groups already created, and with "zillions" of requests for new groups it would overload the database. A simple SQL query could just check the name in the group table quickly, but I wanted to use the API instead, and simplequery() came handy.

      (ok, I know there is the question of why I need zillions of groups and requests, that's another problem :)

      Thank you!

    • As of 1.7 there is no way to get entities by name/title via the API, so you are correct to write your own SQL. We're looking into solutions for 1.8 that would allow sorting / retrieving entities by these attributes.

    • You should be able to do this through elgg_get_entities() by using a custom join and where clause.

  • zootrasgo commented on a bookmark The Elgg Community: SimpleQuery Classes
    Great! The example and the link are exactly what I needed Thank you
  • zootrasgo replied on the discussion topic listing groups
    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... view reply
  • zootrasgo added a new discussion topic listing groups in the group Plugin Development
    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
    • 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

  • zootrasgo joined the group Plugin Development