本文整理汇总了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;
}
示例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');
}
}
示例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());
}
示例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);
}
示例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()]);
}
示例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;
}
示例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;
}