ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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;
36  private StorableResource $resource;
37  private StreamAccess $stream_access;
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  return $revision->maybeStreamResolver()?->getStream();
52  }
53 
57  public function setRevisionNumber(int $revision_number): self
58  {
59  $this->revision_number = $revision_number;
60  return $this;
61  }
62 }
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.