You are here

function _node_limit_sql in Node Limit 8

Same name and namespace in other branches
  1. 6 node_limit.module \_node_limit_sql()
  2. 7 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

int $lid: Identifier of limit rule.

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

File

old/node_limit.module, line 261

Code

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