You are here

function library_get_action in Library 7

Same name and namespace in other branches
  1. 5.2 library.module \library_get_action()
  2. 6.2 library.module \library_get_action()
  3. 6 library.module \library_get_action()

Loads an action.

Parameters

int $aid: The action to load by id.

Return value

bool|object The action as an object.

4 calls to library_get_action()
library_admin_action in ./library.admin.inc
Menu callback: Edit Library Action.
library_may_perform_action in ./library.module
Determine whether a user may perform any library action.
library_transaction_form in ./library.pages.inc
The library transaction form.
library_transaction_form_validate in ./library.pages.inc
Handles transaction form submissions.

File

./library.module, line 1042

Code

function library_get_action($aid) {
  if (!empty($aid) && is_numeric($aid)) {
    $action = db_query('SELECT * FROM {library_actions} WHERE aid = :aid', array(
      ':aid' => $aid,
    ))
      ->fetchObject();
    if ($action) {
      return $action;
    }
    else {
      return FALSE;
    }
  }
  return FALSE;
}