private function getFilePath(File $file)
 {
     $storagePath = __DIR__ . '/../../files/' . date('Y/m/d', strtotime($file->getCreatedAt()));
     if (!is_dir($storagePath)) {
         mkdir($storagePath, 0777, true);
     }
     return $storagePath . '/' . $file->getId();
 }
 private function rowToObject($row)
 {
     if (!$row) {
         return null;
     }
     $obj = new File();
     $obj->setId($row['id'])->setPath($row['path'])->setCreatedAt($row['created_at']);
     return $obj;
 }