function hook_og_membership_type_load

7.x-2.x og.api.php hook_og_membership_type_load(array $og_membership_types)
7.x-1.x og.api.php hook_og_membership_type_load(array $og_membership_types)

Acts on OG membership types being loaded from the database.

This hook is invoked during OG membership type loading, which is handled by entity_load(), via the EntityCRUDController.

Parameters

array $og_membership_types: An array of OG membership type entities being loaded, keyed by id.

See also

hook_entity_load()

File

og/og.api.php, line 251
Hooks provided by the Organic groups module.

Code

function hook_og_membership_type_load(array $og_membership_types) {
  $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;
  }
}