/** * Deactivate user data using user id. * * @access public * @param int $userId [User id] * @return bool */ public function deActivate($userId) { $this->_errorStack = Noobh_ErrorStackSingleton::getInstance(); try { if (!empty($userId)) { $userModel = new Models_User(); $result = $userModel->getUserBy($email = null, $userId); if (!empty($result)) { $status = $userModel->deActivate($userId); return $status; } else { throw new Exception($this->_errorList[602], 602); } } else { throw new Exception($this->_errorList[604], 604); } } catch (Exception $ex) { $code = $ex->getCode(); $message = $ex->getMessage(); $this->_errorStack->push(self::VALIDATION_TYPE, $code, $message); Noobh_Log::error($message); throw new Exception($message); } }