Пример #1
0
 public static function deleteDependentFiles($adverId, $fileName)
 {
     $attachmentPath = Attachment::getAttachmentPath($adverId) . DIRECTORY_SEPARATOR . $fileName;
     if (file_exists($attachmentPath)) {
         @unlink($attachmentPath);
     }
 }
Пример #2
0
 public static function deleteDependentFiles($adverId)
 {
     $galleryPath = Gallery::getImagePath($adverId);
     $attachmentPath = Attachment::getAttachmentPath($adverId);
     if (is_dir($galleryPath)) {
         FileHelper::removeDirectory($galleryPath);
     }
     if (is_dir($attachmentPath)) {
         FileHelper::removeDirectory($attachmentPath);
     }
 }