You are here

protected function crumbs_MultiPlugin_EntityFindAbstract::describeGeneric in Crumbs, the Breadcrumbs suite 7.2

Helper method for describe()

Parameters

crumbs_InjectedAPI_describeMultiPlugin $api:

string $entity_type:

string $label:

Return value

array

1 call to crumbs_MultiPlugin_EntityFindAbstract::describeGeneric()
crumbs_MultiPlugin_EntityFindSomething::describe in lib/MultiPlugin/EntityFindSomething.php

File

lib/MultiPlugin/EntityFindAbstract.php, line 18

Class

crumbs_MultiPlugin_EntityFindAbstract

Code

protected function describeGeneric($api, $entity_type, $label) {
  $info = entity_get_info($entity_type);
  $keys = array();
  foreach ($info['bundles'] as $bundle_key => $bundle) {
    $keys[$bundle_key] = t('!key: !value', array(
      '!key' => $label,
      '!value' => $bundle['label'],
    ));
  }
  if (method_exists($this->plugin, 'describe')) {
    $keys = $this->plugin
      ->describe($api, $entity_type, $keys);
    return $keys;
  }
  else {
    return $keys;
  }
}