You are here

function edit_limit_node_count in Edit Limit 7

Same name and namespace in other branches
  1. 6 edit_limit.module \edit_limit_node_count()

Helper function to get the number of times a particular node has been edited.

2 calls to edit_limit_node_count()
edit_limit_node_prepare in ./edit_limit.module
Implements hook_node_prepare().
_edit_limit_user_acccess in ./edit_limit.module
Helper function to perform additional access checks after node_access() has been checked.
1 string reference to 'edit_limit_node_count'
edit_limit_node_update in ./edit_limit.module
Implements hook_node_update().

File

./edit_limit.module, line 274
edit_limit.module Primary module file for Edit Limit. This contains all the hooks needed to run the module.

Code

function edit_limit_node_count($nid) {
  $count = db_select('edit_limit_node_count', 'e')
    ->fields('e', array(
    'count',
  ))
    ->condition('nid', $nid, '=')
    ->execute()
    ->fetchField();
  $count = empty($count) ? 0 : $count;
  return $count;
}