hits = new ArrayCollection(); } public function addHit(Hit $hit) { $this->hits->add($hit); $this->score += $hit->getScore(); } /** * Gets the value of id. * * @return integer */ public function getId() { return $this->id; } /** * Gets the value of user. * * @return mixed */ public function getUser() { return $this->user; } /** * Gets the value of level. * * @return mixed */ public function getLevel() { return $this->level; } /** * Gets the value of hits. * * @return mixed */ public function getHits() { return $this->hits; } /** * Gets the value of score. * * @return mixed */ public function getScore() { return $this->score; } /** * Gets the value of createdAt. * * @return \DateTime $created */ public function getCreatedAt() { return $this->createdAt; } /** * @todo Em should not be fetched here. Quick fix for now... * * @JMS\VirtualProperty * @return Position */ public function getPosition() { return Application::getInstance()->getEm()->getRepository(static::class)->getPositionForGame($this); } /** * Sets the value of user. * * @param mixed $user the user * * @return self */ public function setUser(User $user) { $this->user = $user; return $this; } /** * Sets the value of level. * * @param mixed $level the level * * @return self */ public function setLevel(Level $level) { $this->level = $level; return $this; } /** * Sets the value of originalGameAt. * * @param \DateTime $date Set the time the original game was played on the device. * * @return self */ public function setOriginalGameAt(\DateTime $date) { $this->originalGameAt = $date; return $this; } }