ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
SrcConsumer.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
25 
31 {
32  use GetRevisionTrait;
33 
34  protected ?int $revision_number = null;
38 
42  public function __construct(SrcBuilder $src_builder, StorableResource $resource, StreamAccess $stream_access)
43  {
44  $this->src_builder = $src_builder;
45  $this->resource = $resource;
46  $this->stream_access = $stream_access;
47  }
48 
49  public function getSrc(bool $signed = false): string
50  {
51  try {
52  return $this->src_builder->getRevisionURL(
53  $this->stream_access->populateRevision($this->getRevision()),
54  $signed,
55  60,
56  null
57  );
58  } catch (\Throwable $e) {
59  return '';
60  }
61 
62  }
63 
67  public function setRevisionNumber(int $revision_number): self
68  {
69  $this->revision_number = $revision_number;
70  return $this;
71  }
72 }
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(SrcBuilder $src_builder, StorableResource $resource, StreamAccess $stream_access)
DownloadConsumer constructor.
Definition: SrcConsumer.php:42