getId() public method

Return the user unique id
public getId ( ) : mixed
return mixed
Example #1
0
 /**
  * This is actually implemented in the base-class
  * @return int
  */
 public function getId()
 {
     return parent::getId();
 }
Example #2
0
 /**
  * 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));
 }
Example #3
0
 protected function saveRegistrationLog(User $user, Referral $referral)
 {
     $reg = new ReferralRegistration();
     $reg->setUserId($user->getId());
     $reg->setReferrer($referral->getReferrer());
     $this->em->persist($reg);
     return $reg;
 }
Example #4
0
 /**
  * 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());
     }
 }
Example #5
0
 /**
  * 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())));
 }