You are here

function hook_og_membership_load in Organic groups 7.2

Same name and namespace in other branches
  1. 7 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

hook_entity_load()

File

./og.api.php, line 384
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($og_memberships),
  ));
  foreach ($result as $record) {
    $og_memberships[$record->pid]->foo = $record->foo;
  }
}