Exemple #1
0
 /**
  * {@inheritdoc}
  */
 public function fileOfId(FileId $anId)
 {
     $statement = $this->execute('SELECT * FROM file WHERE id = :id', ['id' => $anId->id()]);
     if ($row = $statement->fetch(\PDO::FETCH_ASSOC)) {
         return $this->buildFile($row);
     }
 }
Exemple #2
0
 /**
  * Method that checks if the id given is equal to the current.
  *
  * @param FileId $anId The id
  *
  * @return bool
  */
 public function equals(FileId $anId)
 {
     return $this->id() === $anId->id();
 }
 /**
  * {@inheritdoc}
  */
 public function fileOfId(FileId $anId)
 {
     if (isset($this->files[$anId->id()])) {
         return $this->files[$anId->id()];
     }
 }