当前位置: 首页>>代码示例>>PHP>>正文


PHP UserService::save方法代码示例

本文整理汇总了PHP中UserService::save方法的典型用法代码示例。如果您正苦于以下问题:PHP UserService::save方法的具体用法?PHP UserService::save怎么用?PHP UserService::save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserService的用法示例。


在下文中一共展示了UserService::save方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: register

 public function register()
 {
     $this->validate(array('name' => 'required,min(2)', 'email' => 'required,email', 'password' => 'required,min(4)', 'password2' => 'required,min(4),equal(password)'));
     $userDoc = Request::post()->get('name', 'email', 'password');
     $userDoc->password = md5($userDoc->password);
     $userDoc = UserService::save($userDoc);
     if (!$userDoc) {
         MessageHandler::instance()->addError('E-mail was already registered - forgot your password?');
         return;
     }
     $user = new UserModel($userDoc);
     SessionHandler::instance()->setUser($user);
     MessageHandler::instance()->addMessage('You were successfully registered and logged in');
     $this->redirect();
 }
开发者ID:hofmeister,项目名称:ScrumBanana.com,代码行数:15,代码来源:UserController.php

示例2: actionUpdate

 public function actionUpdate()
 {
     $model = UserService::loadModel();
     $this->performAjaxValidation($model);
     if (isset($_POST['User'])) {
         $model->attributes = $_POST['User'];
         if (UserService::save($model)) {
             Flashes::addInfoFlash(Yii::t('amo', 'User updated successfully'));
             $this->redirect(array('view', 'id' => $model->uid));
         } else {
             Flashes::addErrorFlash(Yii::t('amo', 'Could not update the user.') . '  ' . Yii::t('amo', 'Please, try again later.'));
         }
     }
     $this->render('update', array('model' => $model));
 }
开发者ID:CHILMEX,项目名称:amocasion,代码行数:15,代码来源:UserController.php

示例3: editAction

 public function editAction($id)
 {
     $this->response->setTemplate('user-edit');
     $user_service = new UserService();
     $this->response->view->success = "";
     $this->response->view->error = "";
     if ($this->response->getPost() && $user_service->save($this->response->getPost())) {
         #salvo com sucesso
         $this->response->view->success = "Funcionario salvo com sucesso.";
         $this->indexAction();
     } elseif ($this->response->getPost()) {
         /**
          * Mostrar o motivo do porque nao foi salvo
          */
         $this->response->view->error = "Precisa preencher todos os campos obrigatorios!!!";
     }
     $user = $user_service->get($id);
     $this->response->view->user = $user;
 }
开发者ID:richarddaros,项目名称:seminovo24h,代码行数:19,代码来源:userview.php

示例4: User

<?php

require __DIR__ . "/../autoload.php";
$user = new User();
$user->setName("Zachary");
$userService = new UserService();
$userService->save($user);
开发者ID:JoshuaReneDalley,项目名称:php,代码行数:7,代码来源:verifyUserService.php


注:本文中的UserService::save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。