You are here

function node_limit_og_node_limit_sql in Node Limit 6

Implementation of hook_node_limit_sql().

File

node_limit_og/node_limit_og.module, line 25
Module to restrict the number of nodes within an organic group.

Code

function node_limit_og_node_limit_sql($lid) {
  $limit = node_limit_og_node_limit_load($lid);
  if (empty($limit)) {
    return array();
  }

  //TODO
  return array(
    'where' => array(
      sprintf('n.nid IN (SELECT og.nid FROM {og_ancestry} AS og WHERE og.group_nid = \'%d\')', $limit['node_limit_og']),
    ),
  );
}