You are here

class RulesCommentAlterNodeEventHandler in Comment Alter 7

Event handler support comment alter node bundle event settings.

Hierarchy

Expanded class hierarchy of RulesCommentAlterNodeEventHandler

1 string reference to 'RulesCommentAlterNodeEventHandler'
comment_alter_rules_event_info in ./comment_alter.rules.inc
Implements hook_rules_event_info().

File

./comment_alter.rules.inc, line 51
Rules related stuff.

View source
class RulesCommentAlterNodeEventHandler extends RulesEventHandlerEntityBundle {

  /**
   * Implements RulesEventHandlerInterface::__construct()
   */
  public function __construct($event_name, $info) {
    $this->eventName = $event_name;
    $this->eventInfo = $info;
    $this->settings = $this
      ->getDefaults();

    // Cut off the suffix, e.g. remove 'view' from node_view.
    $this->entityType = 'node';
    $this->entityInfo = entity_get_info($this->entityType);
    if (!$this->entityInfo) {
      throw new InvalidArgumentException('Unsupported event name passed.');
    }
  }

  /**
   * Returns the label to use for the bundle property.
   *
   * @return string
   */
  protected function getBundlePropertyLabel() {
    return t('type');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RulesCommentAlterNodeEventHandler::getBundlePropertyLabel protected function Returns the label to use for the bundle property. Overrides RulesEventHandlerEntityBundle::getBundlePropertyLabel
RulesCommentAlterNodeEventHandler::__construct public function Implements RulesEventHandlerInterface::__construct() Overrides RulesEventHandlerEntityBundle::__construct
RulesEventHandlerBase::$eventInfo protected property The event info.
RulesEventHandlerBase::$eventName protected property The event name.
RulesEventHandlerBase::$settings protected property The event settings.
RulesEventHandlerBase::getEventInfo public function Implements RulesEventHandlerInterface::getEventInfo(). Overrides RulesEventHandlerInterface::getEventInfo
RulesEventHandlerBase::getEventName public function Implements RulesEventHandlerInterface::getEventName(). Overrides RulesEventHandlerInterface::getEventName
RulesEventHandlerBase::getSettings public function Implements RulesEventHandlerInterface::getSettings(). Overrides RulesEventHandlerInterface::getSettings 1
RulesEventHandlerBase::setSettings public function Implements RulesEventHandlerInterface::setSettings(). Overrides RulesEventHandlerInterface::setSettings
RulesEventHandlerEntityBundle::$bundleKey protected property
RulesEventHandlerEntityBundle::$entityInfo protected property
RulesEventHandlerEntityBundle::$entityType protected property
RulesEventHandlerEntityBundle::availableVariables public function Implements RulesEventHandlerInterface::availableVariables(). Overrides RulesEventHandlerBase::availableVariables
RulesEventHandlerEntityBundle::buildForm public function Implements RulesEventHandlerInterface::buildForm(). Overrides RulesEventHandlerInterface::buildForm
RulesEventHandlerEntityBundle::extractFormValues public function Implements RulesEventHandlerInterface::extractFormValues(). Overrides RulesEventHandlerBase::extractFormValues
RulesEventHandlerEntityBundle::getDefaults public function Implements RulesEventHandlerInterface::getDefaults(). Overrides RulesEventHandlerInterface::getDefaults
RulesEventHandlerEntityBundle::getEventNameSuffix public function Implements RulesEventHandlerInterface::getConfiguredEventName(). Overrides RulesEventHandlerInterface::getEventNameSuffix
RulesEventHandlerEntityBundle::summary public function Implements RulesEventHandlerInterface::summary(). Overrides RulesEventHandlerInterface::summary
RulesEventHandlerEntityBundle::validate public function Implements RulesEventHandlerInterface::validate(). Overrides RulesEventHandlerBase::validate