1 | <?php |
||
5 | class Post |
||
6 | { |
||
7 | const TYPE_STANDARD = 'standard'; |
||
8 | const TYPE_EXTERNAL = 'external'; |
||
9 | |||
10 | /** |
||
11 | * Post names must be unique. |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $name; |
||
16 | |||
17 | /** |
||
18 | * Date with format YYYY-MM-DD. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $publishDate; |
||
23 | |||
24 | /** |
||
25 | * @var string|null |
||
26 | */ |
||
27 | protected $category; |
||
28 | |||
29 | /** |
||
30 | * @var string[] |
||
31 | */ |
||
32 | protected $tags; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $contentFilepath; |
||
38 | |||
39 | /** |
||
40 | * @param string $contentFilepath |
||
41 | * @param string $name |
||
42 | * @param string $publishDate |
||
43 | * @param string $category |
||
44 | * @param string[] $tags |
||
45 | */ |
||
46 | public function __construct($contentFilepath, $name, $publishDate, $category = null, $tags = []) |
||
63 | |||
64 | /** |
||
65 | * @return string |
||
66 | */ |
||
67 | public function getCategory() |
||
71 | |||
72 | /** |
||
73 | * @return string |
||
74 | */ |
||
75 | public function getContentFilepath() |
||
79 | |||
80 | /** |
||
81 | * @return string |
||
82 | */ |
||
83 | public function getName() |
||
87 | |||
88 | /** |
||
89 | * @return string |
||
90 | */ |
||
91 | public function getPublishDate() |
||
95 | |||
96 | /** |
||
97 | * @return string[] |
||
98 | */ |
||
99 | public function getTags() |
||
103 | |||
104 | /** |
||
105 | * @return string |
||
106 | */ |
||
107 | public function getHtml() |
||
114 | |||
115 | /** |
||
116 | * @return string |
||
117 | */ |
||
118 | public function getType() |
||
122 | |||
123 | /** |
||
124 | * @return string[] |
||
125 | */ |
||
126 | public static function getAvailableBlogTypes() |
||
133 | } |
||
134 |