You are here

function content_lock_fetch_lock in Content locking (anti-concurrent editing) 6

Same name and namespace in other branches
  1. 6.2 content_lock.module \content_lock_fetch_lock()
  2. 7.3 content_lock.module \content_lock_fetch_lock()
  3. 7 content_lock.module \content_lock_fetch_lock()
  4. 7.2 content_lock.module \content_lock_fetch_lock()

Fetch the lock for a node.

Parameters

$nid: A node id.

Return value

The lock for the node. FALSE, if the document is not locked.

4 calls to content_lock_fetch_lock()
ContentLockTestCase::_checkLock in tests/content_lock.test
content_lock_node in ./content_lock.module
Try to lock a document for editing.
content_lock_nodeapi in ./content_lock.module
Implementation of hook_nodeapi().
content_lock_timeout_nodeapi in modules/content_lock_timeout/content_lock_timeout.module
Implemention of hook_form_alter().

File

./content_lock.module, line 335
Allows users to lock documents for modification.

Code

function content_lock_fetch_lock($nid) {
  return db_fetch_object(db_query("SELECT c.*, u.name FROM {content_lock} c LEFT JOIN {users} u ON u.uid = c.uid WHERE c.nid = %d", $nid));
}