function hook_node_limit_load in Node Limit 7
Same name and namespace in other branches
- 8 old/node_limit.api.php \hook_node_limit_load()
Load submodules' data.
Called when node_limit loads a limit from the database.
Parameters
int $lid: The node limit id.
Return value
array An array with a single key-value pair. The key must be the name of the submodule, and the value is an array containing submodule's data.
5 functions implement hook_node_limit_load()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- node_limit_interval_node_limit_load in node_limit_interval/
node_limit_interval.module - Implements hook_node_limit_load().
- node_limit_role_node_limit_load in node_limit_role/
node_limit_role.module - Implements hook_node_limit_load().
- node_limit_type_node_limit_load in node_limit_type/
node_limit_type.module - Implements hook_node_limit_load().
- node_limit_userofrole_node_limit_load in node_limit_userofrole/
node_limit_userofrole.module - Implements hook_node_limit_load().
- node_limit_user_node_limit_load in node_limit_user/
node_limit_user.module - Implements hook_node_limit_load().
1 invocation of hook_node_limit_load()
- node_limit_load in ./
node_limit.module - Loads a node limit.
File
- ./
node_limit.api.php, line 126 - Node_limit api reference.
Code
function hook_node_limit_load($lid) {
$select = db_select('submodule', 'sub');
$select
->join('users', 'u', 'u.uid = sub.uid');
$select
->fields('sub')
->fields('u', array(
'name',
))
->condition('lid', $lid);
$info = $select
->execute()
->fetchAssoc();
if (empty($info['uid'])) {
return array();
}
return array(
'submodule' => array(
'uid' => $info['uid'],
'name' => $info['name'],
),
);
}