You are here

function entity_rules_event_info in Entity API 7

Implements hook_rules_event_info().

File

./entity.rules.inc, line 94
Provides Rules integration for entities provided via the CRUD API.

Code

function entity_rules_event_info() {
  $items = array();
  foreach (entity_crud_get_info() as $type => $info) {

    // By default we enable the controller only for non-configuration.
    $configuration = !empty($info['configuration']) || !empty($info['exportable']);
    $info += array(
      'rules controller class' => $configuration ? FALSE : 'EntityDefaultRulesController',
    );
    if ($info['rules controller class']) {
      $controller = new $info['rules controller class']($type);
      $items += $controller
        ->eventInfo();
    }
  }
  return $items;
}