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