/** * {@inheritdoc} */ public function userOfId(UserId $anId) { $statement = $this->execute('SELECT * FROM user WHERE id = :id', ['id' => $anId->id()]); if ($row = $statement->fetch(\PDO::FETCH_ASSOC)) { return $this->buildUser($row); } }
/** * {@inheritdoc} */ public function userOfId(UserId $anId) { if (isset($this->users[$anId->id()])) { return $this->users[$anId->id()]; } }
/** * Method that checks if the id given is equal to the current. * * @param UserId $anId The id * * @return bool */ public function equals(UserId $anId) { return $this->id() === $anId->id(); }