當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。