Esempio n. 1
0
 /**
  * {@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);
     }
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function userOfId(UserId $anId)
 {
     if (isset($this->users[$anId->id()])) {
         return $this->users[$anId->id()];
     }
 }
Esempio n. 3
0
 /**
  * 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();
 }