You are here

function rules_comment in Rules 6

Implementation of hook_comment().

Related topics

File

rules/modules/rules.events.inc, line 77
Invokes events for supported modules. Usually this should be directly in the module providing rules integration instead.

Code

function rules_comment($comment, $op) {
  if (in_array($op, array(
    'insert',
    'update',
    'delete',
    'view',
    'publish',
    'unpublish',
  ))) {
    if (is_array($comment)) {
      $comment = (object) $comment;
    }
    rules_invoke_event('comment_' . $op, $comment);
  }
}