You are here

function _cer_entity_bundles in Corresponding Entity References 7

Helper function. Returns entity "bundle" keys.

Parameters

$entity_types Array containing "home" and "away" keys.:

File

./cer.module, line 323
Module file providing the "corresponding entity reference" module main functions.

Code

function _cer_entity_bundles($entity_types) {
  $types = entity_get_info();
  foreach ($types as $key => $type) {
    $entity_type_id[$key] = $type['entity keys']['bundle'];
  }
  $bundles = array(
    'home' => $entity_type_id[$entity_types['home']],
    'away' => $entity_type_id[$entity_types['away']],
  );
  return $bundles;
}