@@ 129-138 (lines=10) @@ | ||
126 | /** |
|
127 | * {@inheritdoc} |
|
128 | */ |
|
129 | public function fileOfName(FileName $aName) |
|
130 | { |
|
131 | $statement = $this->execute('SELECT * FROM file WHERE name = :name AND extension = :extension', [ |
|
132 | 'name' => $aName->name(), |
|
133 | 'extension' => $aName->extension(), |
|
134 | ]); |
|
135 | if ($row = $statement->fetch(\PDO::FETCH_ASSOC)) { |
|
136 | return $this->buildFile($row); |
|
137 | } |
|
138 | } |
|
139 | ||
140 | /** |
|
141 | * {@inheritdoc} |
|
@@ 143-151 (lines=9) @@ | ||
140 | /** |
|
141 | * {@inheritdoc} |
|
142 | */ |
|
143 | public function all() |
|
144 | { |
|
145 | $statement = $this->execute('SELECT * FROM file'); |
|
146 | if ($rows = $statement->fetch(\PDO::FETCH_ASSOC)) { |
|
147 | return array_map(function ($row) { |
|
148 | return $this->buildFile($row); |
|
149 | }, $rows); |
|
150 | } |
|
151 | } |
|
152 | ||
153 | /** |
|
154 | * {@inheritdoc} |