You are here

function rules_entity_bundle_options in Rules 7.2

Options list callback for getting a list of possible entity bundles.

Parameters

$element: The element to return options for.

Related topics

1 string reference to 'rules_entity_bundle_options'
rules_entity_condition_info in modules/entity.rules.inc
Implements hook_rules_condition_info() on behalf of the entity module.

File

modules/entity.rules.inc, line 294
General entity related rules integration.

Code

function rules_entity_bundle_options(RulesAbstractPlugin $element) {
  $bundles = array();
  if (isset($element->settings['type'])) {
    $entity_info = entity_get_info($element->settings['type']);
    foreach ($entity_info['bundles'] as $bundle_name => $bundle_info) {
      $bundles[$bundle_name] = $bundle_info['label'];
    }
  }
  return $bundles;
}