concrete/src/Entity/File/Version.php
public function deleteThumbnail($type)
    {
        $app = Application::getFacadeApplication();
        $config = $app->make('config');
        if (!($type instanceof ThumbnailTypeVersion)) {
            $type = ThumbnailTypeVersion::getByHandle($type);
        }
        $fsl = $this->getFile()->getFileStorageLocationObject()->getFileSystemObject();
        $path = $type->getFilePath($this);
        try {
            if ($fsl->has($path)) {
                $fsl->delete($path);

                $app['director']->dispatch('on_thumbnail_delete',
                    new \Concrete\Core\File\Event\ThumbnailDelete($path, $type)
                );
            }
        } catch (FileNotFoundException $e) {
        }
        if ($type->getHandle() == $config->get('concrete.icons.file_manager_listing.handle') && $this->fvHasListingThumbnail) {
            $this->fvHasListingThumbnail = false;
            $this->save();
        }
        if ($type->getHandle() == $config->get('concrete.icons.file_manager_detail.handle') && $this->fvHasDetailThumbnail) {
            $this->fvHasDetailThumbnail = false;
            $this->save();
        }
    }
public function deleteThumbnail($type)
    {
        $app = Application::getFacadeApplication();
        $config = $app->make('config');
        if (!($type instanceof ThumbnailTypeVersion)) {
            $type = ThumbnailTypeVersion::getByHandle($type);
        }
        $fsl = $this->getFile()->getFileStorageLocationObject()->getFileSystemObject();
        $path = $type->getFilePath($this);
        try {
            if ($fsl->has($path)) {
                $fsl->delete($path);

                $app['director']->dispatch('on_thumbnail_delete',
                    new \Concrete\Core\File\Event\ThumbnailDelete($path, $type)
                );
            }
        } catch (FileNotFoundException $e) {
        }
        if ($type->getHandle() == $config->get('concrete.icons.file_manager_listing.handle') && $this->fvHasListingThumbnail) {
            $this->fvHasListingThumbnail = false;
            $this->save();
        }
        if ($type->getHandle() == $config->get('concrete.icons.file_manager_detail.handle') && $this->fvHasDetailThumbnail) {
            $this->fvHasDetailThumbnail = false;
            $this->save();
        }
    }
public function deleteThumbnail ( $ type ) { $ app = Application :: getFacadeApplication ( ) ; $ config = $ app -> make ( 'config' ) ; if ( ! ( $ type instanceof ThumbnailTypeVersion ) ) { $ type = ThumbnailTypeVersion :: getByHandle ( $ type ) ; } $ fsl = $ this -> getFile ( ) -> getFileStorageLocationObject ( ) -> getFileSystemObject ( ) ; $ path = $ type -> getFilePath ( $ this ) ; try { if ( $ fsl -> has ( $ path ) ) { $ fsl -> delete ( $ path ) ; $ app [ 'director' ] -> dispatch ( 'on_thumbnail_delete' , new \ Concrete \ Core \ File \ Event \ ThumbnailDelete ( $ path , $ type ) ) ; } } catch ( FileNotFoundException $ e ) { } if ( $ type -> getHandle ( ) == $ config -> get ( 'concrete.icons.file_manager_listing.handle' ) && $ this -> fvHasListingThumbnail ) { $ this -> fvHasListingThumbnail = false ; $ this -> save ( ) ; } if ( $ type -> getHandle ( ) == $ config -> get ( 'concrete.icons.file_manager_detail.handle' ) && $ this -> fvHasDetailThumbnail ) { $ this -> fvHasDetailThumbnail = false ; $ this -> save ( ) ; } }
Delete the thumbnail for a specific thumbnail type version.

@param \Concrete\Core\File\Image\Thumbnail\Type\Version|string $type the thumbnail type version (or its handle)
Delete the thumbnail for a specific thumbnail type version .