public function isLocked()
{
// check for an locked element below this element
$belowLocks = $this->db->fetchOne("SELECT tree_locks.id FROM tree_locks\n INNER JOIN documents ON tree_locks.id = documents.id\n WHERE documents.path LIKE ? AND tree_locks.type = 'document' AND tree_locks.locked IS NOT NULL AND tree_locks.locked != '' LIMIT 1", $this->model->getRealFullPath() . "/%");
if ($belowLocks > 0) {
return true;
}
$parentIds = $this->getParentIds();
$inhertitedLocks = $this->db->fetchOne("SELECT id FROM tree_locks WHERE id IN (" . implode(",", $parentIds) . ") AND type='document' AND locked = 'propagate' LIMIT 1");
if ($inhertitedLocks > 0) {
return true;
}
return false;
}