You are here

function notifications_content_install_trigger_action in Notifications 7

Create trigger assignement

2 calls to notifications_content_install_trigger_action()
notifications_content_install in notifications_content/notifications_content.install
Implementation of hook_install().
notifications_tags_install in notifications_tags/notifications_tags.install
Implementation of hook_install().

File

notifications_content/notifications_content.install, line 26

Code

function notifications_content_install_trigger_action($trigger, $action) {
  $check = db_select('trigger_assignments', 'ta')
    ->fields('ta', array(
    'hook',
    'aid',
  ))
    ->condition('hook', $trigger)
    ->condition('aid', $action)
    ->execute()
    ->fetchObject();
  if (!$check) {
    db_insert('trigger_assignments')
      ->fields(array(
      'hook' => $trigger,
      'aid' => $action,
    ))
      ->execute();
  }
}