Added ability to lock unlock any unit, and to track that based on the actual locks that are on it, not the lock status.
git-svn-id: file:///svn-source/pmgr/branches/v0.3_work@1042 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -248,6 +248,23 @@ class Unit extends AppModel {
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
**************************************************************************
|
||||
* function: lockCount
|
||||
* - Number of locks on a unit
|
||||
*/
|
||||
function lockCount($id) {
|
||||
$this->prEnter(compact('id'));
|
||||
return $this->prReturn($this->find
|
||||
('count', array
|
||||
('fields' => array("COUNT(Lock.id) AS count"),
|
||||
'link' => array('Lock'),
|
||||
'conditions' => array('Unit.id' => $id),
|
||||
)));
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
**************************************************************************
|
||||
**************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user