public static function deleteDependentFiles($adverId, $fileName) { $attachmentPath = Attachment::getAttachmentPath($adverId) . DIRECTORY_SEPARATOR . $fileName; if (file_exists($attachmentPath)) { @unlink($attachmentPath); } }
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); } }