function hook_og_membership_load in Organic groups 7
Same name and namespace in other branches
- 7.2 og.api.php \hook_og_membership_load()
Acts on OG memberships being loaded from the database.
This hook is invoked during OG membership loading, which is handled by entity_load(), via the EntityCRUDController.
Parameters
array $og_memberships: An array of OG membership entities being loaded, keyed by id.
See also
File
- ./
og.api.php, line 425 - Hooks provided by the Organic groups module.
Code
function hook_og_membership_load(array $og_memberships) {
$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;
}
}