/** * checkLock() helper * * @param string resource path to check for locks * @return bool true on success */ function checkLock($path) { WebdavLockPeer::removeOutdatedLocks(); $oCriteria = new Criteria(); $oCriteria->add(WebdavLockPeer::PATH, $path); $oLock = WebdavLockPeer::doSelectOne($oCriteria); if ($oLock === null) { return false; } return array("type" => $oLock->getIsExclusive() ? "write" : 'read', "scope" => $oLock->getIsExclusive() ? "exclusive" : "shared", "depth" => 0, "owner" => $oLock->getUser()->getUsername(), "token" => $oLock->getToken(), "created" => $oLock->getCreatedAt('U'), "modified" => $oLock->getUpdatedAt('U'), "expires" => $oLock->getExpiresAt('U')); }