You are here

class WatchdogRulesController in Better Watchdog UI 7

Same name and namespace in other branches
  1. 8 better_watchdog_ui_rules/better_watchdog_ui_rules.rules.inc \WatchdogRulesController
  2. 7.3 better_watchdog_ui_rules/better_watchdog_ui_rules.rules.inc \WatchdogRulesController
  3. 7.2 better_watchdog_ui_rules/better_watchdog_ui_rules.rules.inc \WatchdogRulesController

Controller for generating Rules integration.

Hierarchy

Expanded class hierarchy of WatchdogRulesController

1 string reference to 'WatchdogRulesController'
better_watchdog_ui_rules_entity_info_alter in better_watchdog_ui_rules/better_watchdog_ui_rules.module
Implements hook_entity_info_alter().

File

better_watchdog_ui_rules/better_watchdog_ui_rules.rules.inc, line 11
General better_watchdog_ui related rules integration.

View source
class WatchdogRulesController {
  protected $type;
  protected $info;

  /**
   * Constructor.
   */
  public function __construct() {
    $this->type = 'better_watchdog_ui_watchdog';
    $this->info = entity_get_info('better_watchdog_ui_watchdog');
  }

  /**
   * Generate event related info.
   */
  public function eventInfo() {
    $type = $this->type;
    $defaults = array(
      'module' => 'better_watchdog_ui',
      'group' => 'Better Watchdog UI',
      'access callback' => 'access site reports',
    );
    $items['better_watchdog_ui_watchdog_view'] = $defaults + array(
      'label' => t('A watchdog entry is viewed'),
      'variables' => entity_rules_events_variables($type, t('viewed better_watchdog_ui_watchdog')),
    );
    $items['better_watchdog_ui_watchdog_create'] = $defaults + array(
      'label' => t('After saving a new watchdog entry'),
      'variables' => entity_rules_events_variables($type, t('created better_watchdog_ui_watchdog')),
    );
    $items['better_watchdog_ui_watchdog_before_delete'] = $defaults + array(
      'label' => t('Before deleting a watchdog entry'),
      'variables' => entity_rules_events_variables($type, t('before deleted better_watchdog_ui_watchdog')),
    );
    $items['better_watchdog_ui_watchdog_after_delete'] = $defaults + array(
      'label' => t('After deleting a watchdog entry'),
      'variables' => entity_rules_events_variables($type, t('after deleted better_watchdog_ui_watchdog')),
    );
    return $items;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
WatchdogRulesController::$info protected property
WatchdogRulesController::$type protected property
WatchdogRulesController::eventInfo public function Generate event related info.
WatchdogRulesController::__construct public function Constructor.