ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
BaseConsumer.php
Go to the documentation of this file.
1 <?php declare(strict_types=1);
2 
4 
8 
13 abstract class BaseConsumer implements DeliveryConsumer
14 {
15  use GetRevisionTrait;
16 
20  protected $storage_handler;
24  protected $resource;
28  protected $revision_number = null;
32  protected $file_name_policy;
36  protected $file_name = '';
37 
44  public function __construct(
48  )
49  {
50  $this->resource = $resource;
51  $this->storage_handler = $storage_handler;
52  $this->file_name_policy = $file_name_policy;
53  $this->file_name = $resource->getCurrentRevision()->getInformation()->getTitle();
54  }
55 
56  abstract public function run() : void;
57 
62  {
63  $this->revision_number = $revision_number;
64  return $this;
65  }
66 
67  public function overrideFileName(string $file_name) : DeliveryConsumer
68  {
69  $this->file_name = $file_name;
70  return $this;
71  }
72 
73 }
run()
This runs the actual DeliveryConsumer.
__construct(StorableResource $resource, StorageHandler $storage_handler, FileNamePolicy $file_name_policy)
DownloadConsumer constructor.