trigger_get_assigned_actions

function trigger_get_assigned_actions

trigger_get_assigned_actions($hook)

Gets the action IDs of actions to be executed for a hook.

Parameters

$hook: The name of the hook being fired.

Return value

An array whose keys are action IDs that the user has associated with this trigger, and whose values are arrays containing the action type and label.

File

modules/trigger/trigger.module, line 188
Enables functions to be stored and executed at a later time.

Code

function trigger_get_assigned_actions($hook) {
  $actions = &drupal_static(__FUNCTION__, array());
  if (!isset($actions[$hook])) {
    $actions[$hook] = db_query("SELECT ta.aid, a.type, a.label FROM {trigger_assignments} ta LEFT JOIN {actions} a ON ta.aid = a.aid WHERE ta.hook = :hook ORDER BY ta.weight", array(
      ':hook' => $hook,
    ))->fetchAllAssoc('aid', PDO::FETCH_ASSOC);
  }
  return $actions[$hook];
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!trigger!trigger.module/function/trigger_get_assigned_actions/7.x

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部