/** * Deletes all thumbnails under the given path defined by the resource type, * path and file name. * * @param ResourceType $resourceType * @param string $path * @param string $fileName * * @return bool `true` if deleted successfully */ public function deleteThumbnails(ResourceType $resourceType, $path, $fileName = null) { $path = Path::combine($this->getThumbnailsPath(), $resourceType->getName(), $path, $fileName); if ($this->thumbsBackend->has($path)) { return $this->thumbsBackend->deleteDir($path); } return false; }
/** * Deletes all cache entries with given key prefix * * @param string $keyPrefix * * @return bool true if successful */ public function deleteByPrefix($keyPrefix) { $cachePath = $this->createCachePath($keyPrefix, true); if ($this->backend->hasDirectory($cachePath)) { return $this->backend->deleteDir($cachePath); } return false; }