function hook_group_load in Organic groups 7
Acts on OG groups being loaded from the database.
This hook is invoked during OG group loading, which is handled by entity_load(), via the EntityCRUDController.
Parameters
array og_groups: An array of OG group entities being loaded, keyed by id.
See also
File
- ./
og.api.php, line 228 - Hooks provided by the Organic groups module.
Code
function hook_group_load(array $og_groups) {
$result = db_query('SELECT pid, foo FROM {mytable} WHERE pid IN(:ids)', array(
':ids' => array_keys($entities),
));
foreach ($result as $record) {
$entities[$record->pid]->foo = $record->foo;
}
}