You are here

function entity_dependency_iterator in Entity Dependency API 7

Factory function for an entity dependency iterator.

The $entities array should be structured as below, where all string keys are entity types and the numeric keys are entity ids.

$entities = array(
  'node' => array(
    10,
    12,
  ),
  'taxonomy_term' => array(
    16,
  ),
);
1 call to entity_dependency_iterator()
EntityDependencyTestCase::getIterator in ./entity_dependency.test
Helper method to return the iterator.

File

./entity_dependency.module, line 25
Entity Depedendency module functions.

Code

function entity_dependency_iterator($entities, $plugin = 'default_iterator') {
  if (module_exists('ctools')) {
    $class_name = ctools_plugin_load_class('entity_dependency', 'iterator', $plugin, 'handler');
    $iterator = new $class_name($entities);
  }
  else {
    $iterator = new EntityDependencyIterator($entities);
  }
  return new EntityDependencyIteratorIterator($iterator);
}