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


PHP UserPeer::retrieveByPk方法代码示例

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


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

示例1: getOwnerUser

 public function getOwnerUser()
 {
     if (!is_null($this->getOwnerId())) {
         return UserPeer::retrieveByPk($this->getOwnerId());
     }
     return null;
 }
开发者ID:jfesquet,项目名称:tempos,代码行数:7,代码来源:Message.php

示例2: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->forward404Unless($user = UserPeer::retrieveByPk($request->getParameter('id')), sprintf('Object user does not exist (%s).', $request->getParameter('id')));
     $user->delete();
     $this->redirect('user/index');
 }
开发者ID:nikos2009,项目名称:szkolenie,代码行数:7,代码来源:actions.class.php

示例3: executeChangepassword

 public function executeChangepassword(sfWebRequest $request)
 {
     $this->form = new ChangePasswordForm();
     $this->user = UserPeer::retrieveByPk($this->getUser()->getAttribute('user_id'));
     if ($request->isMethod('post')) {
         // if the form is submitted
         $this->form->bind($request->getParameter('changepassword'));
         if ($this->form->isValid()) {
             $pass_parameters = $request->getParameter('changepassword');
             $password = new Password($pass_parameters['new_password']);
             $current_password = new Password($pass_parameters['password']);
             if ($this->user->checkPassword($current_password)) {
                 $this->user->setPassword($password);
                 $this->getUser()->setFlash('notice', "You have changed your password successfully");
             } else {
                 $this->getUser()->setFlash('notice', "Please type your existing password correctly");
                 $this->redirect('user/changepassword');
             }
             $this->redirect('user/show?id=' . $this->user->getId());
         }
     } else {
         // not a post, just a get
         //		$this->setTemplate('changepassword');
     }
 }
开发者ID:habtom,项目名称:uas,代码行数:25,代码来源:actions.class.php

示例4: getUserFullname

 public function getUserFullname()
 {
     $userid = $this->getUserId();
     // Serves as an intermediary between the users and tbe databbase
     $user = UserPeer::retrieveByPk($userid);
     return $user->__toString();
 }
开发者ID:habtom,项目名称:uas,代码行数:7,代码来源:FtpAccount.php

示例5: executeDelete

 public function executeDelete()
 {
     $user = UserPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($user);
     $user->delete();
     return $this->redirect('user/list');
 }
开发者ID:arrisray,项目名称:askeet,代码行数:7,代码来源:actions.class.php

示例6: getSubscriber

 public function getSubscriber()
 {
     if ($this->isAuthenticated()) {
         return UserPeer::retrieveByPk($this->getSubscriberId());
     } else {
         return null;
     }
 }
开发者ID:emacsattic,项目名称:symfony,代码行数:8,代码来源:myUser.class.php

示例7: executeListExtend

 public function executeListExtend(sfWebRequest $request)
 {
     $id = $request->getParameter('id');
     $user = UserPeer::retrieveByPk($id);
     $user->displayExtendExpiresAt();
     $this->getUser()->setFlash('notice', 'Account expriry time has been extended successfully.');
     $this->redirect('user/ListShow?id=' . $id);
 }
开发者ID:habtom,项目名称:uas,代码行数:8,代码来源:actions.class.php

示例8: getProfile

 public function getProfile()
 {
     $user = UserPeer::retrieveByPk($this->getAttribute('profile', '', 'manager'));
     if ($user) {
         $user->setActivity(date('r'));
         $user->save();
     }
     return $user;
 }
开发者ID:snoopckuu,项目名称:prmanagment,代码行数:9,代码来源:myUser.class.php

示例9: executeNavigation

 public function executeNavigation()
 {
     $this->person = $this->getUser()->getPerson();
     $activityId = $this->getUser()->getAttribute('activityId');
     if ($this->getUser()->hasActivity($activityId)) {
         $this->activity = ActivityPeer::retrieveByPk($activityId);
     } else {
         $this->activity = null;
     }
     $this->usergroup = UsergroupPeer::retrieveByPk($this->getUser()->getAttribute('usergroupId'));
     $this->user = UserPeer::retrieveByPk($this->getUser()->getAttribute('userId'));
 }
开发者ID:jfesquet,项目名称:tempos,代码行数:12,代码来源:components.class.php

示例10: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $user = UserPeer::retrieveByPk(Utility::DecryptQueryString($request->getParameter('id')));
     if ($user) {
         $user->setStatus(Constant::RECORD_STATUS_DELETED);
         if ($user->save()) {
             $this->getUser()->setFlash('SUCCESS_MESSAGE', Constant::RECORD_STATUS_DELETED_SUCCESSFULLY);
         } else {
             $this->getUser()->setFlash('ERROR_MESSAGE', Constant::DB_ERROR);
         }
     } else {
         $this->getUser()->setFlash('ERROR_MESSAGE', Constant::INVALID_REQUEST);
     }
     $this->redirect('User/list');
 }
开发者ID:lejacome,项目名称:hospital-mgt,代码行数:15,代码来源:actions.class.php

示例11: executeCreate

 public function executeCreate(sfWebRequest $request)
 {
     $this->forward404Unless($request->isMethod('post'));
     if ($request->hasParameter('userId')) {
         $this->forward404Unless($this->user = UserPeer::retrieveByPk($request->getParameter('userId')), sprintf('Object user does not exist (%s).', $request->getParameter('userId')));
         $this->form = new SubscriptionForm();
         $this->processForm($request, $this->form);
         $this->form->setDefaultUser($this->user);
     } elseif ($request->hasParameter('cardId')) {
         $this->forward404Unless($this->card = CardPeer::retrieveByPk($request->getParameter('cardId')), sprintf('Object card does not exist (%s).', $request->getParameter('cardId')));
         $this->form = new SubscriptionForm();
         $this->processForm($request, $this->form);
         $this->form->setDefaultCard($this->card);
     } else {
         $this->forward404('No user or card specified.');
     }
     $this->setTemplate('new');
 }
开发者ID:jfesquet,项目名称:tempos,代码行数:18,代码来源:actions.class.php

示例12: executeDelete

 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->forward404Unless($user = UserPeer::retrieveByPk($request->getParameter('id')), sprintf('Object user does not exist (%s).', $request->getParameter('id')));
     try {
         $user->delete();
         $par = "";
         if ($request->hasParameter("page")) {
             $par = "?page=" . $request->getParameter("page");
         }
         $this->redirect('adminuser/index' . $par);
     } catch (Exception $e) {
         $this->globalErrors = $e->getMessage();
         $this->user_list = $this->getUserList();
         $values = array('edit' => 'true');
         $this->form = new UserForm($user, $values);
         $this->setTemplate("index");
     }
 }
开发者ID:rafd,项目名称:SkuleCourses,代码行数:19,代码来源:actions.class.php

示例13: doClean

 protected function doClean($values)
 {
     if (is_null($values)) {
         $values = array();
     }
     if (!is_array($values)) {
         throw new InvalidArgumentException('You must pass an array parameter to the clean() method');
     }
     $id = $values['id'];
     $user = UserPeer::retrieveByPk($id);
     if (!is_null($id) && !is_null($user)) {
         $password = $values[$this->getOption('password_field')];
         if (!empty($password) && !$user->checkPassword($password)) {
             $error = new sfValidatorError($this, 'invalid', array());
             if ($this->getOption('throw_global_error')) {
                 throw $error;
             }
             throw new sfValidatorErrorSchema($this, array($this->getOption('password_field') => $error));
         }
     }
     return $values;
 }
开发者ID:jfesquet,项目名称:tempos,代码行数:22,代码来源:sfValidatorPasswordCheck.class.php

示例14: getUser

 /**
  * Get the associated User object
  *
  * @param      PropelPDO Optional Connection object.
  * @return     User The associated User object.
  * @throws     PropelException
  */
 public function getUser(PropelPDO $con = null)
 {
     if ($this->aUser === null && $this->user_id !== null) {
         $this->aUser = UserPeer::retrieveByPk($this->user_id);
         /* The following can be used additionally to
         		   guarantee the related object contains a reference
         		   to this object.  This level of coupling may, however, be
         		   undesirable since it could result in an only partially populated collection
         		   in the referenced object.
         		   $this->aUser->addComments($this);
         		 */
     }
     return $this->aUser;
 }
开发者ID:alexspark21,项目名称:symfony_bisM,代码行数:21,代码来源:BaseComment.php

示例15: ChangePassword

 public static function ChangePassword($old_password, $new_password)
 {
     //get User ID from session and get user object
     $user_id = sfContext::getInstance()->getUser()->getAttribute('USER_ID');
     $user = UserPeer::retrieveByPk($user_id);
     //Get post data
     //if old password is correct then set new one
     if (strcmp($user->getPassword(), self::EncryptPassword($old_password)) == 0) {
         $new_password = self::EncryptPassword($new_password);
         $user->setPassword($new_password);
         //Save password
         if ($user->save()) {
             return Constant::LOGIN_PASSWORD_CHANGED_SUCCESS;
         } else {
             return Constant::DB_ERROR;
         }
     } else {
         return Constant::LOGIN_INVALID_OLD_PASSWORD;
     }
 }
开发者ID:lejacome,项目名称:hospital-mgt,代码行数:20,代码来源:Login.php


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