1 | <?php |
||
17 | class Comments extends RelatedModule |
||
18 | { |
||
19 | /** @var string Widget type. */ |
||
20 | protected $type = 'Comments'; |
||
21 | |||
22 | /** @var string Module name. */ |
||
23 | protected $moduleName; |
||
24 | |||
25 | /** @var int Source record ID. */ |
||
26 | protected $recordId; |
||
27 | |||
28 | /** @var int Page number. */ |
||
29 | protected $page = 1; |
||
30 | |||
31 | /** @var bool More pages. */ |
||
32 | protected $isMorePages; |
||
33 | |||
34 | /** @var array Scripts. */ |
||
35 | public $scripts = []; |
||
36 | |||
37 | /** @var int Limit. */ |
||
38 | public $limit = 5; |
||
39 | |||
40 | /** |
||
41 | * Constructor. |
||
42 | * |
||
43 | * @param string $moduleName |
||
44 | */ |
||
45 | public function __construct(string $moduleName) |
||
49 | |||
50 | /** |
||
51 | * Gets widget ID. |
||
52 | * |
||
53 | * @return int |
||
54 | */ |
||
55 | public function getId() |
||
59 | |||
60 | /** |
||
61 | * Gets widget type. |
||
62 | * |
||
63 | * @return string |
||
64 | */ |
||
65 | public function getType(): string |
||
69 | |||
70 | /** |
||
71 | * Gets module name. |
||
72 | * |
||
73 | * @return string |
||
74 | */ |
||
75 | public function getModuleName(): string |
||
79 | |||
80 | /** |
||
81 | * Gets widget name. |
||
82 | * |
||
83 | * @return string |
||
84 | */ |
||
85 | public function getTitle(): string |
||
89 | |||
90 | /** |
||
91 | * Sets record ID. |
||
92 | * |
||
93 | * @param int $recordId |
||
94 | * |
||
95 | * @return $this |
||
96 | */ |
||
97 | public function setRecordId(int $recordId) |
||
103 | |||
104 | /** |
||
105 | * Gets record ID. |
||
106 | * |
||
107 | * @return int |
||
108 | */ |
||
109 | public function getRecordId(): int |
||
113 | |||
114 | /** |
||
115 | * Get URL address. |
||
116 | * |
||
117 | * @return string |
||
118 | */ |
||
119 | public function getUrl(): string |
||
123 | |||
124 | /** |
||
125 | * Set page number. |
||
126 | * |
||
127 | * @param int $page |
||
128 | * |
||
129 | * @return $this |
||
130 | */ |
||
131 | public function setPage(int $page) |
||
136 | |||
137 | /** |
||
138 | * Get page number. |
||
139 | * |
||
140 | * @return int |
||
141 | */ |
||
142 | public function getPage(): int |
||
146 | |||
147 | /** |
||
148 | * Gets fields from related module. |
||
149 | * |
||
150 | * @return array |
||
151 | */ |
||
152 | public function getFields(): array |
||
157 | |||
158 | /** |
||
159 | * Gets related module name. |
||
160 | * |
||
161 | * @return string |
||
162 | */ |
||
163 | public function getRelatedModuleName(): string |
||
167 | |||
168 | /** |
||
169 | * Check if is more pages. |
||
170 | * |
||
171 | * @return bool |
||
172 | */ |
||
173 | public function isMorePages(): bool |
||
177 | |||
178 | /** |
||
179 | * Load data. |
||
180 | * |
||
181 | * @return $this |
||
182 | */ |
||
183 | public function loadData() |
||
203 | |||
204 | /** |
||
205 | * Gets template path for widget. |
||
206 | * |
||
207 | * @return string |
||
208 | */ |
||
209 | public function getTemplatePath(): string |
||
213 | |||
214 | /** |
||
215 | * Gets template path for widget content. |
||
216 | * |
||
217 | * @return string |
||
218 | */ |
||
219 | public function getTemplateContentPath(): string |
||
223 | |||
224 | /** |
||
225 | * Set scripts. |
||
226 | * |
||
227 | * @param array $scripts |
||
228 | */ |
||
229 | public function setScriptsObject($scripts) |
||
233 | |||
234 | /** |
||
235 | * Gets scripts. |
||
236 | * |
||
237 | * @return array |
||
238 | */ |
||
239 | public function getScripts(): array |
||
246 | } |
||
247 |