ILIAS  release_8 Revision v8.24
ILIAS\ResourceStorage\Consumer\Consumers Class Reference
+ Collaboration diagram for ILIAS\ResourceStorage\Consumer\Consumers:

Public Member Functions

 __construct (ConsumerFactory $consumer_factory, ResourceBuilder $resource_builder, CollectionBuilder $collection_builder, ?SrcBuilder $src_builder=null)
 Consumers constructor. More...
 
 download (ResourceIdentification $identification)
 
 inline (ResourceIdentification $identification)
 
 stream (ResourceIdentification $identification)
 
 src (ResourceIdentification $identification)
 
 downloadCollection (ResourceCollectionIdentification $identification, ?string $zip_filename=null)
 
 downloadResources (array $identifications, ?string $zip_filename=null)
 

Private Attributes

ConsumerFactory $consumer_factory
 
ResourceBuilder $resource_builder
 
CollectionBuilder $collection_builder
 
SrcBuilder $src_builder = null
 

Detailed Description

Definition at line 33 of file Consumers.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\ResourceStorage\Consumer\Consumers::__construct ( ConsumerFactory  $consumer_factory,
ResourceBuilder  $resource_builder,
CollectionBuilder  $collection_builder,
?SrcBuilder  $src_builder = null 
)

Member Function Documentation

◆ download()

ILIAS\ResourceStorage\Consumer\Consumers::download ( ResourceIdentification  $identification)

Definition at line 55 of file Consumers.php.

55 : DownloadConsumer
56 {
57 return $this->consumer_factory->download($this->resource_builder->get($identification));
58 }

◆ downloadCollection()

ILIAS\ResourceStorage\Consumer\Consumers::downloadCollection ( ResourceCollectionIdentification  $identification,
?string  $zip_filename = null 
)

Definition at line 75 of file Consumers.php.

78 : DownloadMultipleConsumer {
79 return $this->downloadResources(
80 iterator_to_array($this->collection_builder->getResourceIds($identification)),
81 $zip_filename
82 );
83 }
downloadResources(array $identifications, ?string $zip_filename=null)
Definition: Consumers.php:85

◆ downloadResources()

ILIAS\ResourceStorage\Consumer\Consumers::downloadResources ( array  $identifications,
?string  $zip_filename = null 
)

Definition at line 85 of file Consumers.php.

88 : DownloadMultipleConsumer {
89 $resources = [];
90 foreach ($identifications as $rid) {
91 if (!$rid instanceof ResourceIdentification) {
92 throw new \InvalidArgumentException('Expected ResourceIdentification');
93 }
94 $resources[] = $this->resource_builder->get($rid);
95 }
96
97 return $this->consumer_factory->downloadMultiple(
99 $zip_filename
100 );
101 }
$resources
Definition: ltiservices.php:68

References $resources.

◆ inline()

ILIAS\ResourceStorage\Consumer\Consumers::inline ( ResourceIdentification  $identification)

Definition at line 60 of file Consumers.php.

60 : InlineConsumer
61 {
62 return $this->consumer_factory->inline($this->resource_builder->get($identification));
63 }

◆ src()

ILIAS\ResourceStorage\Consumer\Consumers::src ( ResourceIdentification  $identification)

Definition at line 70 of file Consumers.php.

70 : SrcConsumer
71 {
72 return $this->consumer_factory->src($this->resource_builder->get($identification), $this->src_builder);
73 }

◆ stream()

ILIAS\ResourceStorage\Consumer\Consumers::stream ( ResourceIdentification  $identification)

Definition at line 65 of file Consumers.php.

65 : FileStreamConsumer
66 {
67 return $this->consumer_factory->fileStream($this->resource_builder->get($identification));
68 }

Field Documentation

◆ $collection_builder

CollectionBuilder ILIAS\ResourceStorage\Consumer\Consumers::$collection_builder
private

Definition at line 37 of file Consumers.php.

Referenced by ILIAS\ResourceStorage\Consumer\Consumers\__construct().

◆ $consumer_factory

ConsumerFactory ILIAS\ResourceStorage\Consumer\Consumers::$consumer_factory
private

Definition at line 35 of file Consumers.php.

Referenced by ILIAS\ResourceStorage\Consumer\Consumers\__construct().

◆ $resource_builder

ResourceBuilder ILIAS\ResourceStorage\Consumer\Consumers::$resource_builder
private

Definition at line 36 of file Consumers.php.

Referenced by ILIAS\ResourceStorage\Consumer\Consumers\__construct().

◆ $src_builder

SrcBuilder ILIAS\ResourceStorage\Consumer\Consumers::$src_builder = null
private

Definition at line 38 of file Consumers.php.

Referenced by ILIAS\ResourceStorage\Consumer\Consumers\__construct().


The documentation for this class was generated from the following file: