You are here

function group_load_by_property in Group 7

Load all groups with a given property value.

Parameters

string $property: The property name you wish to filter on.

string $value: The property value you wish to filter on.

Return value

array An array of Group entities, keyed by their group ids.

2 calls to group_load_by_property()
group_load_by_name in helpers/group.entity.inc
Load all groups with a given name.
group_load_by_type in helpers/group.entity.inc
Load all groups of a given type.

File

helpers/group.entity.inc, line 51
Entity API related helper functions for groups.

Code

function group_load_by_property($property, $value) {
  $query = new EntityFieldQuery();
  $query
    ->entityCondition('entity_type', 'group');
  $query
    ->propertyCondition($property, $value);
  $result = $query
    ->execute();
  return isset($result['group']) ? group_load_multiple(array_keys($result['group'])) : array();
}