ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\LegalDocuments\Consumer\Consumers Class Reference
+ Collaboration diagram for ILIAS\LegalDocuments\Consumer\Consumers:

Public Member Functions

 __construct (private ConsumerFactory $consumer_factory, private ResourceBuilder $resource_builder, private CollectionBuilder $collection_builder, private SrcBuilder $src_builder=new InlineSrcBuilder())
 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)
 
 flavourUrls (Flavour $flavour)
 
 containerZIP (ResourceIdentification $identification)
 This consumer can be used to obtain a StorageContainerResource as a ZIP. More...
 
 containerURI (ResourceIdentification $identification, string $start_file='index.html', float $valid_for_at_least_minutes=60.0)
 

Detailed Description

Definition at line 36 of file Consumers.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LegalDocuments\Consumer\Consumers::__construct ( private ConsumerFactory  $consumer_factory,
private ResourceBuilder  $resource_builder,
private CollectionBuilder  $collection_builder,
private SrcBuilder  $src_builder = new InlineSrcBuilder() 
)

Consumers constructor.

Definition at line 41 of file Consumers.php.

42  {
43  }

Member Function Documentation

◆ containerURI()

ILIAS\LegalDocuments\Consumer\Consumers::containerURI ( ResourceIdentification  $identification,
string  $start_file = 'index.html',
float  $valid_for_at_least_minutes = 60.0 
)

Definition at line 113 of file Consumers.php.

References ILIAS\ResourceStorage\Resource\CONTAINER.

117  : ContainerURIConsumer {
118  $resource = $this->resource_builder->get($identification);
119  if ($resource->getType() !== ResourceType::CONTAINER || !$resource instanceof StorableContainerResource) {
120  throw new \InvalidArgumentException('Expected StorableContainerResource');
121  }
122  return $this->consumer_factory->containerURI(
123  $resource,
124  $this->src_builder,
125  ltrim($start_file, '/'),
126  $valid_for_at_least_minutes
127  );
128  }

◆ containerZIP()

ILIAS\LegalDocuments\Consumer\Consumers::containerZIP ( ResourceIdentification  $identification)

This consumer can be used to obtain a StorageContainerResource as a ZIP.

Definition at line 101 of file Consumers.php.

References ILIAS\ResourceStorage\Resource\CONTAINER.

101  : ContainerZIPAccessConsumer
102  {
103  $resource = $this->resource_builder->get($identification);
104  if ($resource->getType() !== ResourceType::CONTAINER || !$resource instanceof StorableContainerResource) {
105  throw new \InvalidArgumentException('Expected StorableContainerResource');
106  }
107 
108  return $this->consumer_factory->containerZIP(
109  $resource
110  );
111  }

◆ download()

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

Definition at line 45 of file Consumers.php.

45  : DownloadConsumer
46  {
47  return $this->consumer_factory->download($this->resource_builder->get($identification));
48  }

◆ downloadCollection()

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

Definition at line 65 of file Consumers.php.

References ILIAS\LegalDocuments\Consumer\Consumers\downloadResources().

68  : DownloadMultipleConsumer {
69  return $this->downloadResources(
70  iterator_to_array($this->collection_builder->getResourceIds($identification)),
71  $zip_filename
72  );
73  }
downloadResources(array $identifications, ?string $zip_filename=null)
Definition: Consumers.php:75
+ Here is the call graph for this function:

◆ downloadResources()

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

Definition at line 75 of file Consumers.php.

References $resources.

Referenced by ILIAS\LegalDocuments\Consumer\Consumers\downloadCollection().

78  : DownloadMultipleConsumer {
79  $resources = [];
80  foreach ($identifications as $rid) {
81  if (!$rid instanceof ResourceIdentification) {
82  throw new \InvalidArgumentException('Expected ResourceIdentification');
83  }
84  $resources[] = $this->resource_builder->get($rid);
85  }
86 
87  return $this->consumer_factory->downloadMultiple(
88  $resources,
89  $zip_filename
90  );
91  }
$resources
Definition: ltiservices.php:65
+ Here is the caller graph for this function:

◆ flavourUrls()

ILIAS\LegalDocuments\Consumer\Consumers::flavourUrls ( Flavour  $flavour)

Definition at line 93 of file Consumers.php.

93  : FlavourURLs
94  {
95  return $this->consumer_factory->flavourUrl($flavour, $this->src_builder);
96  }

◆ inline()

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

Definition at line 50 of file Consumers.php.

50  : InlineConsumer
51  {
52  return $this->consumer_factory->inline($this->resource_builder->get($identification));
53  }

◆ src()

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

Definition at line 60 of file Consumers.php.

60  : SrcConsumer
61  {
62  return $this->consumer_factory->src($this->resource_builder->get($identification), $this->src_builder);
63  }

◆ stream()

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

Definition at line 55 of file Consumers.php.

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

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