ILIAS  release_7 Revision v7.30-3-g800a261c036
BaseConsumer.php
Go to the documentation of this file.
1<?php declare(strict_types=1);
2
4
8
13abstract class BaseConsumer implements DeliveryConsumer
14{
15 use GetRevisionTrait;
16
24 protected $resource;
28 protected $revision_number = null;
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
68 {
69 $this->file_name = $file_name;
70 return $this;
71 }
72
73}
An exception for terminatinating execution or to throw for unit testing.
__construct(StorableResource $resource, StorageHandler $storage_handler, FileNamePolicy $file_name_policy)
DownloadConsumer constructor.
setRevisionNumber(int $revision_number)
@inheritDoc
run()
This runs the actual DeliveryConsumer.