You are here

function _node_limit_sql in Node Limit 7

Same name and namespace in other branches
  1. 8 old/node_limit.module \_node_limit_sql()
  2. 6 node_limit.module \_node_limit_sql()

Generates the sql statement to find the nodes that apply to a particular limit. Modules that implement hook_node_limit_sql() should sprintf their arguments into the returned array. This will be changed in Drupal 7, which will be able to accept an array of arguments to db_query().

Parameters

$lid: Identifier of limit rule.

1 call to _node_limit_sql()
_node_limit_violates_limit in ./node_limit.module
Helper function to check limit violations for this node. Always returns FALSE for user 1.

File

./node_limit.module, line 276

Code

function _node_limit_sql($lid) {
  $select = db_select('node', 'n');
  $select
    ->addExpression('COUNT(n.nid)', 'number');
  module_invoke_all('node_limit_sql', $lid, $select);
  return $select;
}