本文整理汇总了PHP中FOS\UserBundle\Model\User::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP User::getId方法的具体用法?PHP User::getId怎么用?PHP User::getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FOS\UserBundle\Model\User
的用法示例。
在下文中一共展示了User::getId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getId
/**
* This is actually implemented in the base-class
* @return int
*/
public function getId()
{
return parent::getId();
}
示例2: createRecentByUsersQuery
/**
* Find games played between these two players
*
* @return array of Game
*/
public function createRecentByUsersQuery(User $playerA, User $playerB)
{
return $this->createRecentQuery()->field('userIds')->all(array($playerA->getId(), $playerB->getId()))->hint(array('userIds' => 1));
}
示例3: saveRegistrationLog
protected function saveRegistrationLog(User $user, Referral $referral)
{
$reg = new ReferralRegistration();
$reg->setUserId($user->getId());
$reg->setReferrer($referral->getReferrer());
$this->em->persist($reg);
return $reg;
}
示例4: setUser
/**
* Set the user bound to this player
*
* @param User $user
* @return null
*/
public function setUser(User $user = null)
{
$this->user = $user;
if ($this->user) {
$this->elo = $user->getElo();
$this->getGame()->addUserId($user->getId());
}
}
示例5: createRecentByUsersQuery
/**
* Find games played between these two players
*
* @return array of Game
*/
public function createRecentByUsersQuery(User $playerA, User $playerB)
{
$qb = $this->createRecentQuery();
return $qb->addOr($qb->expr()->field('userIds')->equals(array($playerA->getId(), $playerB->getId())))->addOr($qb->expr()->field('userIds')->equals(array($playerB->getId(), $playerA->getId())));
}