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 | * Get URL address. |
||
106 | * |
||
107 | * @return string |
||
108 | */ |
||
109 | public function getUrl(): string |
||
113 | |||
114 | /** |
||
115 | * Set page number. |
||
116 | * |
||
117 | * @param int $page |
||
118 | * |
||
119 | * @return $this |
||
120 | */ |
||
121 | public function setPage(int $page) |
||
126 | |||
127 | /** |
||
128 | * Get page number. |
||
129 | * |
||
130 | * @return int |
||
131 | */ |
||
132 | public function getPage(): int |
||
136 | |||
137 | /** |
||
138 | * Gets fields from related module. |
||
139 | * |
||
140 | * @return array |
||
141 | */ |
||
142 | public function getFields(): array |
||
147 | |||
148 | /** |
||
149 | * Gets related module name. |
||
150 | * |
||
151 | * @return string |
||
152 | */ |
||
153 | public function getRelatedModuleName(): string |
||
157 | |||
158 | /** |
||
159 | * Check if is more pages. |
||
160 | * |
||
161 | * @return bool |
||
162 | */ |
||
163 | public function isMorePages(): bool |
||
167 | |||
168 | /** |
||
169 | * Load data. |
||
170 | * |
||
171 | * @return $this |
||
172 | */ |
||
173 | public function loadData() |
||
184 | |||
185 | /** |
||
186 | * Gets template path for widget. |
||
187 | * |
||
188 | * @return string |
||
189 | */ |
||
190 | public function getTemplatePath(): string |
||
194 | |||
195 | /** |
||
196 | * Gets template path for widget content. |
||
197 | * |
||
198 | * @return string |
||
199 | */ |
||
200 | public function getTemplateContentPath(): string |
||
204 | |||
205 | /** |
||
206 | * Set scripts. |
||
207 | * |
||
208 | * @param array $scripts |
||
209 | */ |
||
210 | public function setScriptsObject($scripts) |
||
214 | |||
215 | /** |
||
216 | * Gets scripts. |
||
217 | * |
||
218 | * @return array |
||
219 | */ |
||
220 | public function getScripts(): array |
||
227 | } |
||
228 |