1 | <?php |
||
18 | 1 | class Generator { |
|
19 | 1 | use \Nette\SmartObject; |
|
20 | |||
21 | /** @var string */ |
||
22 | protected $title = ""; |
||
23 | /** @var string */ |
||
24 | protected $description = ""; |
||
25 | /** @var string */ |
||
26 | protected $link = ""; |
||
27 | /** @var string */ |
||
28 | protected $dateTimeFormat = "Y-m-d H:i:s"; |
||
29 | /** @var callable|null */ |
||
30 | protected $dataSource = NULL; |
||
31 | /** @var int */ |
||
32 | protected $shortenDescription = 150; |
||
33 | /** @var callable */ |
||
34 | protected $lastBuildDate = "time"; |
||
35 | |||
36 | public function getTitle(): string { |
||
39 | |||
40 | public function setTitle(string $title) { |
||
43 | |||
44 | public function getDescription(): string { |
||
47 | |||
48 | public function setDescription(string $description) { |
||
51 | |||
52 | public function getLink(): string { |
||
55 | |||
56 | public function setLink(string $link) { |
||
59 | |||
60 | public function setDataSource(callable $dataSource) { |
||
63 | |||
64 | public function getShortenDescription(): int { |
||
67 | |||
68 | public function setShortenDescription(int $value) { |
||
71 | |||
72 | public function getDateTimeFormat(): string { |
||
75 | |||
76 | public function setDateTimeFormat(string $format) { |
||
79 | |||
80 | public function getLastBuildDate() { |
||
83 | |||
84 | public function setLastBuildDate(callable $lastBuildDate) { |
||
87 | |||
88 | /** |
||
89 | * @throws InvalidStateException |
||
90 | * @throws \InvalidArgumentException |
||
91 | */ |
||
92 | protected function getData(): Collection { |
||
102 | |||
103 | protected function shortenDescription(string $description): string { |
||
114 | |||
115 | /** |
||
116 | * @throws InvalidStateException |
||
117 | * @throws \InvalidArgumentException |
||
118 | */ |
||
119 | public function generate(): \SimpleXMLElement { |
||
147 | |||
148 | /** |
||
149 | * @throws InvalidStateException |
||
150 | * @throws \InvalidArgumentException |
||
151 | */ |
||
152 | public function response(): RssResponse { |
||
159 | } |
||
160 | ?> |