setOptions($options); } public function exec() { $result = false; $resourceName = Qs_Request::getRequestValue('resourceName'); $objectId = Qs_Request::getRequestValue('objectId'); foreach ($this->_authClasses as $class) { if (false !== ($auth = $this->_getAuth($class)) && $auth->isLoggedIn()) { $this->_doc->setAuth($auth); $result = $this->_doc->getLockObj()->lock($resourceName, $objectId); } } $this->_displayJson(array('status' => $result)); } /** * @param string $class Auth class name * @return Qs_Auth|bool return Qs_Auth object on success or false on error */ protected function _getAuth($class) { if (class_exists($class)) { return $class::getInstance(); } return false; } }