本文整理汇总了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;
}