Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | public function delete($id) |
||
17 | { |
||
18 | $query = $this->pdo->prepare("DELETE FROM {$this->prefix}galleries WHERE id = :id"); |
||
19 | $query->bindValue(':id', $id, \PDO::PARAM_INT); |
||
20 | |||
21 | $f = (new One\Model())->getGalleryInfoById($id); |
||
22 | $config = (new Module('galleries'))->getConfig(); |
||
23 | $directory = $config['path_root'].'/'.$f['slug']; |
||
24 | array_map('unlink', glob($directory.'/*')); |
||
25 | rmdir($directory); |
||
26 | |||
27 | return $query->execute(); |
||
28 | } |
||
29 | } |
||
30 |