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