| @@ -1,15 +1,13 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace Mgleis\DiskUsageInsights\Domain; |
| 4 | 4 | |
| 5 | -use PDO; | |
| 6 | - | |
| 7 | 5 | class FileEntryRepository { |
| 8 | 6 | |
| 9 | - private PDO $db; | |
| 7 | + private \PDO $db; | |
| 10 | 8 | |
| 11 | - public function __construct(PDO $db) { | |
| 9 | + public function __construct(\PDO $db) { | |
| 12 | 10 | $this->db = $db; |
| 13 | 11 | $this->initializeDatabase(); |
| 14 | 12 | } |
| 15 | 13 | |
| @@ -70,9 +68,9 @@ | ||
| 70 | 68 | SELECT * FROM fileentries WHERE id =:id |
| 71 | 69 | "); |
| 72 | 70 | $stmt->bindValue(':id', $id); |
| 73 | 71 | $stmt->execute(); |
| 74 | - $result = $stmt->fetch(PDO::FETCH_ASSOC); | |
| 72 | + $result = $stmt->fetch(\PDO::FETCH_ASSOC); | |
| 75 | 73 | if ($result === false) { |
| 76 | 74 | throw new \Exception(sprintf("No file entry with id %s found.", esc_html($id))); |
| 77 | 75 | } |
| 78 | 76 | |
| @@ -101,9 +99,9 @@ | ||
| 101 | 99 | "); |
| 102 | 100 | $stmt->bindValue(':parent_id', $parentId); |
| 103 | 101 | $stmt->bindValue(':name', $part); |
| 104 | 102 | $stmt->execute(); |
| 105 | - $result = $stmt->fetch(PDO::FETCH_ASSOC); | |
| 103 | + $result = $stmt->fetch(\PDO::FETCH_ASSOC); | |
| 106 | 104 | if ($result === false) { |
| 107 | 105 | throw new \Exception(sprintf("Error finding %s", esc_html($relativeFilename))); |
| 108 | 106 | } |
| 109 | 107 | $parentId = $result['id']; |
| @@ -158,9 +156,9 @@ | ||
| 158 | 156 | $stmt = $this->db->prepare(" |
| 159 | 157 | SELECT * FROM fileentries WHERE type in ($types) LIMIT $count OFFSET $skip |
| 160 | 158 | "); |
| 161 | 159 | $stmt->execute(); |
| 162 | - $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); | |
| 160 | + $rows = $stmt->fetchAll(\PDO::FETCH_ASSOC); | |
| 163 | 161 | |
| 164 | 162 | $results = []; |
| 165 | 163 | foreach ($rows as $row) { |
| 166 | 164 | $entry = new FileEntry(); |