Исправление ошибки в File::delete(). Не работало удаление вариантов старых изображений

This commit is contained in:
2014-11-29 10:53:50 +03:00
parent cd5c27893d
commit 57f402dd63

View File

@ -118,12 +118,12 @@ abstract class File
if ($this->getIsNoEmpty()) {
@unlink($this->getRealPath());
}
if (get_parent_class($this) == 'Image') {
if (get_parent_class($this) == 'dimti\Image\Image') {
$image = $this;
foreach ($image->getSizes() as $size) {
$image_variant = $image->getVariant($size);
if ($image_variant->getIsNoEmpty()) {
@unlink($image->getRealPath());
@unlink($image_variant->getRealPath());
}
}
}