/**
* Publishes the whole collection to this target
*
* @param CollectionInterface $collection The collection to publish
* @param callable $callback Function called after each resource publishing
* @return void
*/
public function publishCollection(CollectionInterface $collection, callable $callback = null)
{
$storage = $collection->getStorage();
if ($storage instanceof PackageStorage) {
foreach ($storage->getPublicResourcePaths() as $packageKey => $path) {
$this->publishDirectory($path, $packageKey);
}
} else {
parent::publishCollection($collection, $callback);
}
}