ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
FileStreamConsumer.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 
32 {
33  use GetRevisionTrait;
34 
35  protected ?int $revision_number = null;
38 
42  public function __construct(StorableResource $resource, StreamAccess $stream_access)
43  {
44  $this->resource = $resource;
45  $this->stream_access = $stream_access;
46  }
47 
48  public function getStream(): FileStream
49  {
50  $revision = $this->stream_access->populateRevision($this->getRevision());
51 
52  return $revision->maybeGetToken()->resolveStream();
53  }
54 
58  public function setRevisionNumber(int $revision_number): self
59  {
60  $this->revision_number = $revision_number;
61  return $this;
62  }
63 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(StorableResource $resource, StreamAccess $stream_access)
DownloadConsumer constructor.
Interface FileStream.
Definition: FileStream.php:33