You are here

function uuid_entity_uuid_get_children in Universally Unique IDentifier 7

Fetches all children types for a given parent entity.

@todo document me properly.

Return value

array All the children.

1 call to uuid_entity_uuid_get_children()
uuid_entity_uuid_get_child in plugins/arguments/entity_uuid.inc
Fetches the "child" information for a given parent entity.
1 string reference to 'uuid_entity_uuid_get_children'
entity_uuid.inc in plugins/arguments/entity_uuid.inc
Plugin to provide an argument handler for all entity IDs.

File

plugins/arguments/entity_uuid.inc, line 40
Plugin to provide an argument handler for all entity IDs.

Code

function uuid_entity_uuid_get_children($original_plugin, $parent) {
  $entities = entity_get_info();
  $plugins = array();
  foreach ($entities as $entity_type => $entity) {
    $plugin = $original_plugin;
    $plugin['title'] = t('@entity: UUID', array(
      '@entity' => $entity['label'],
    ));
    $plugin['keyword'] = $entity_type;
    $plugin['description'] = t('Creates @entity context from an UUID argument.', array(
      '@entity' => $entity_type,
    ));
    $plugin['name'] = $parent . ':' . $entity_type;
    $plugin_id = $parent . ':' . $entity_type;
    drupal_alter('ctools_entity_context', $plugin, $entity, $plugin_id);
    $plugins[$plugin_id] = $plugin;
  }
  drupal_alter('ctools_entity_contexts', $plugins);
  return $plugins;
}