1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
|
4
|
|
|
namespace Nexendrie\Rss; |
5
|
|
|
|
6
|
|
|
/** |
7
|
|
|
* Rss Channel Item |
8
|
|
|
* |
9
|
|
|
* @author Jakub Konečný |
10
|
|
|
* @property string $title |
11
|
|
|
* @property string $description |
12
|
|
|
* @property string $link |
13
|
|
|
* @property int $pubDate |
14
|
|
|
* @property string $author |
15
|
|
|
* @property string $comments |
16
|
|
|
* @property string $guid |
17
|
|
|
* @property \Nexendrie\Utils\Collection|Category[] $categories |
18
|
|
|
*/ |
19
|
1 |
|
class RssChannelItem { |
20
|
1 |
|
use \Nette\SmartObject; |
21
|
|
|
|
22
|
|
|
/** @var string */ |
23
|
|
|
protected $title; |
24
|
|
|
/** @var string */ |
25
|
|
|
protected $description; |
26
|
|
|
/** @var string */ |
27
|
|
|
protected $link; |
28
|
|
|
/** @var int */ |
29
|
|
|
protected $pubDate; |
30
|
|
|
/** @var string */ |
31
|
|
|
protected $author = ""; |
32
|
|
|
/** @var string */ |
33
|
|
|
protected $comments = ""; |
34
|
|
|
/** @var string */ |
35
|
|
|
protected $guid = ""; |
36
|
|
|
/** @var \Nexendrie\Utils\Collection|Category[] */ |
37
|
|
|
protected $categories; |
38
|
|
|
|
39
|
|
|
public function __construct(string $title, string $description, string $link, int $pubDate) { |
40
|
1 |
|
$this->title = $title; |
41
|
1 |
|
$this->description = $description; |
42
|
1 |
|
$this->link = $link; |
43
|
1 |
|
$this->pubDate = $pubDate; |
44
|
1 |
|
$this->categories = new class extends \Nexendrie\Utils\Collection { |
45
|
|
|
/** @var string */ |
46
|
|
|
protected $class = Category::class; |
47
|
|
|
}; |
48
|
1 |
|
} |
49
|
|
|
|
50
|
|
|
public function getTitle(): string { |
51
|
1 |
|
return $this->title; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public function setTitle(string $title): void { |
55
|
1 |
|
$this->title = $title; |
56
|
1 |
|
} |
57
|
|
|
|
58
|
|
|
public function getDescription(): string { |
59
|
1 |
|
return $this->description; |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
public function setDescription(string $description): void { |
63
|
1 |
|
$this->description = $description; |
64
|
1 |
|
} |
65
|
|
|
|
66
|
|
|
public function getLink(): string { |
67
|
1 |
|
return $this->link; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
public function setLink(string $link): void { |
71
|
1 |
|
$this->link = $link; |
72
|
1 |
|
} |
73
|
|
|
|
74
|
|
|
public function getPubDate(): int { |
75
|
1 |
|
return $this->pubDate; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
public function setPubDate(int $pubDate): void { |
79
|
1 |
|
$this->pubDate = $pubDate; |
80
|
1 |
|
} |
81
|
|
|
|
82
|
|
|
public function getAuthor(): string { |
83
|
1 |
|
return $this->author; |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
public function setAuthor(string $author): void { |
87
|
1 |
|
$this->author = $author; |
88
|
1 |
|
} |
89
|
|
|
|
90
|
|
|
public function getComments(): string { |
91
|
1 |
|
return $this->comments; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
public function setComments(string $comments): void { |
95
|
1 |
|
$this->comments = $comments; |
96
|
1 |
|
} |
97
|
|
|
|
98
|
|
|
public function getGuid(): string { |
99
|
1 |
|
return $this->guid; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
public function setGuid(string $guid): void { |
103
|
1 |
|
$this->guid = $guid; |
104
|
1 |
|
} |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* @return \Nexendrie\Utils\Collection|Category[] |
108
|
|
|
*/ |
109
|
|
|
public function getCategories(): \Nexendrie\Utils\Collection { |
110
|
1 |
|
return $this->categories; |
111
|
|
|
} |
112
|
|
|
} |
113
|
|
|
?> |