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


PHP User::getId方法代码示例

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


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

示例1: mapToDataObject

 /**
  * @param User $user
  * @return UserDataObject
  */
 public function mapToDataObject(User $user)
 {
     $userDataObject = new UserDataObject();
     $userDataObject->id = $user->getId();
     $userDataObject->name = $user->getName();
     $userDataObject->passwordHash = $user->getPasswordHash();
     return $userDataObject;
 }
开发者ID:flonology,项目名称:UrlKeeper,代码行数:12,代码来源:UserDataObjectMapper.php

示例2: filterByUser

 /**
  * Filter the query by a related \Model\User object
  *
  * @param \Model\User|ObjectCollection $user The related object(s) to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @throws \Propel\Runtime\Exception\PropelException
  *
  * @return ChildTruckQuery The current query, for fluid interface
  */
 public function filterByUser($user, $comparison = null)
 {
     if ($user instanceof \Model\User) {
         return $this->addUsingAlias(TruckTableMap::COL_USER_ID, $user->getId(), $comparison);
     } elseif ($user instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(TruckTableMap::COL_USER_ID, $user->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByUser() only accepts arguments of type \\Model\\User or Collection');
     }
 }
开发者ID:hackathon-5,项目名称:power-ragers-repo,代码行数:23,代码来源:TruckQuery.php

示例3: sendRecoveryCode

 /**
  * Send user account recovery code.
  *
  * @access   public
  * @param    User $oUser
  * @since    1.0.0, 2015-02-17
  * @version  2.1.0-dev
  * @return   bool
  */
 private function sendRecoveryCode(User $oUser)
 {
     $sUserAgent = filter_input(INPUT_SERVER, 'HTTP_USER_AGENT');
     $sCodeToEncode = mb_strlen(uniqid()) * time() . $sUserAgent . $oUser->getLogin();
     $sCode2 = sha1($sCodeToEncode);
     $sRecoveryCode = base64_encode($sCode2);
     DB::query('DELETE FROM \\Model\\User\\RecoveryCode r WHERE r.user = :user')->param('user', $oUser->getId())->execute(TRUE);
     $oRecoveryCode = new User\RecoveryCode();
     $oRecoveryCode->setUser($oUser);
     $oRecoveryCode->setCode($sRecoveryCode);
     DB::persist($oRecoveryCode);
     DB::flush();
     $sSubject = __('Account activation on :app', ['app' => Core::getAppName()]);
     $mailContent = View::factory("user/frontend/recovery/message")->render(['sLogin' => $oUser->getLogin(), 'sRecoveryCode' => $sRecoveryCode]);
     $mailView = View::factory('base/email');
     $mailView->bind('sContent', $mailContent);
     $mailView->set('sTitle', $sSubject);
     return $oUser->sendEmail($sSubject, $mailView->render());
 }
开发者ID:ktrzos,项目名称:plethora,代码行数:28,代码来源:PasswordRecovery.php

示例4: persist

 function persist(User $user)
 {
     $requete = "INSERT INTO user(id, login, password) value(:id, :login,:password)";
     $param = array('id' => $user->getId(), 'login' => $user->getLogin(), 'password' => $user->getPassword());
     $this->conn->prepareAndExecuteQuery($requete, $param);
 }
开发者ID:jbrat,项目名称:uFrameworkPHP,代码行数:6,代码来源:UserMapper.php

示例5: persist

 public function persist(User $user)
 {
     $query = "INSERT INTO USERS VALUES (:user_id, :user_name, :user_password)";
     return $this->connection->executeQuery($query, [':user_id' => $user->getId(), ':user_name' => $user->getName(), ':user_password' => $user->getPassword()]);
 }
开发者ID:yannisrichard,项目名称:uframework,代码行数:5,代码来源:UserMapper.php

示例6: prune

 /**
  * Exclude object from result
  *
  * @param   ChildUser $user Object to remove from the list of results
  *
  * @return $this|ChildUserQuery The current query, for fluid interface
  */
 public function prune($user = null)
 {
     if ($user) {
         $this->addUsingAlias(UserTableMap::COL_ID, $user->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
开发者ID:hackathon-5,项目名称:power-ragers-repo,代码行数:14,代码来源:UserQuery.php

示例7: setUser

 /**
  * Declares an association between this object and a ChildUser object.
  *
  * @param  ChildUser $v
  * @return $this|\Model\AccessToken The current object (for fluent API support)
  * @throws PropelException
  */
 public function setUser(ChildUser $v = null)
 {
     if ($v === null) {
         $this->setUserId(NULL);
     } else {
         $this->setUserId($v->getId());
     }
     $this->aUser = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the ChildUser object, it will not be re-added.
     if ($v !== null) {
         $v->addAccessToken($this);
     }
     return $this;
 }
开发者ID:hackathon-5,项目名称:power-ragers-repo,代码行数:22,代码来源:AccessToken.php


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