19 declare(strict_types=1);
60 return $this->consumer_factory->download($this->resource_builder->get($identification));
65 return $this->consumer_factory->inline($this->resource_builder->get($identification));
70 return $this->consumer_factory->fileStream($this->resource_builder->get($identification));
75 return $this->consumer_factory->src($this->resource_builder->get($identification),
$this->src_builder);
80 ?
string $zip_filename = null
83 iterator_to_array($this->collection_builder->getResourceIds($identification)),
89 array $identifications,
90 ?
string $zip_filename = null
93 foreach ($identifications as $rid) {
95 throw new \InvalidArgumentException(
'Expected ResourceIdentification');
97 $resources[] = $this->resource_builder->get($rid);
100 return $this->consumer_factory->downloadMultiple(
108 return $this->consumer_factory->flavourUrl($flavour, $this->src_builder);
116 $resource = $this->resource_builder->get($identification);
118 throw new \InvalidArgumentException(
'Expected StorableContainerResource');
121 return $this->consumer_factory->containerZIP(
128 string $start_file =
'index.html',
129 float $valid_for_at_least_minutes = 60.0
131 $resource = $this->resource_builder->get($identification);
133 throw new \InvalidArgumentException(
'Expected StorableContainerResource');
135 return $this->consumer_factory->containerURI(
138 ltrim($start_file,
'/'),
139 $valid_for_at_least_minutes
download(ResourceIdentification $identification)
ConsumerFactory $consumer_factory
Class ResourceCollectionIdentification.
CollectionBuilder $collection_builder
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
containerURI(ResourceIdentification $identification, string $start_file='index.html', float $valid_for_at_least_minutes=60.0)
downloadResources(array $identifications, ?string $zip_filename=null)
ResourceBuilder $resource_builder
Class ResourceIdentification.
flavourUrls(Flavour $flavour)
containerZIP(ResourceIdentification $identification)
This consumer can be used to obtain a StorageContainerResource as a ZIP.
__construct(ConsumerFactory $consumer_factory, ResourceBuilder $resource_builder, CollectionBuilder $collection_builder, ?SrcBuilder $src_builder=null)
Consumers constructor.
src(ResourceIdentification $identification)
downloadCollection(ResourceCollectionIdentification $identification, ?string $zip_filename=null)
stream(ResourceIdentification $identification)