當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserDAO::save方法代碼示例

本文整理匯總了PHP中UserDAO::save方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserDAO::save方法的具體用法?PHP UserDAO::save怎麽用?PHP UserDAO::save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UserDAO的用法示例。


在下文中一共展示了UserDAO::save方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: handleRequest

 protected function handleRequest()
 {
     $this->errorMessageContainer = $this->form->getValidationResults();
     if (!$this->errorMessageContainer->isAnyErrorMessage()) {
         $userEmail = $this->form->getField('userEmail')->getValue();
         $record = $this->dao->getActiveUserByEmail($userEmail);
         if ($record['userState'] != 'active') {
             $this->errorMessageContainer->addMessage('errorInvalidUserEmail');
         } else {
             $record['userPasswordChangeCode'] = $this->dao->getNewPasswordChangeCode($record);
             $this->dao->save($record);
             $this->sendPasswordRecoveryEmail($record);
             $this->redirectAddress = CoreServices2::getUrl()->getCurrentPageUrl('_sm', 'SendLink');
         }
     }
 }
開發者ID:piotrPiechura,項目名稱:3dPathProject,代碼行數:16,代碼來源:UserWebsitePasswordRecovery1Controller.class.php

示例2: handleRequest

 protected function handleRequest()
 {
     $this->errorMessageContainer = $this->form->getValidationResults();
     if (!$this->errorMessageContainer->isAnyErrorMessage()) {
         if ($this->record['id']) {
             $this->record['userPasswordChangeCode'] = null;
             $this->record['userPassword'] = $this->form->getField('userPassword')->getValue();
             $this->dao->save($this->record);
             CoreServices2::getAccess()->login($this->record['userEmail'], $this->record['userPassword']);
             $this->redirectAddress = CoreServices2::getUrl()->getCurrentPageUrl('_sm', 'Save', 'id', $this->record['id']);
         }
     }
 }
開發者ID:piotrPiechura,項目名稱:3dPathProject,代碼行數:13,代碼來源:UserWebsitePasswordRecovery2Controller.class.php

示例3: changeUserCredits

 protected function changeUserCredits(&$user, $change, $newPackageId = null)
 {
     $user = $this->userDAO->getRecordById($user['id']);
     // nie chcemy nulla...
     if (empty($user['userCredits'])) {
         $user['userCredits'] = 0;
     }
     $userOld = $user;
     // kopia, nie referencja
     $package = $this->creditsPackageDAO->getLastActiveCreditsPackage($user['id'], $newPackageId);
     if (empty($package['id'])) {
         $user['userCredits'] = 0;
     }
     if ($user['userCredits'] + $change < 0) {
         if ($userOld != $user) {
             $this->userDAO->save($user);
         }
         return false;
     }
     $user['userCredits'] = $user['userCredits'] + $change;
     $this->userDAO->save($user);
     return true;
 }
開發者ID:piotrPiechura,項目名稱:3dPathProject,代碼行數:23,代碼來源:UserCreditsLogic.class.php


注:本文中的UserDAO::save方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。