@@ 42-47 (lines=6) @@ | ||
39 | public function getAll(): array |
|
40 | { |
|
41 | $widgets = []; |
|
42 | if (\App\Cache::has('Widgets', $this->moduleName)) { |
|
43 | $widgetsData = \App\Cache::get('Widgets', $this->moduleName); |
|
44 | } else { |
|
45 | $widgetsData = \App\Api::getInstance()->call("{$this->moduleName}/Widgets") ?: []; |
|
46 | \App\Cache::save('Widgets', $this->moduleName, $widgetsData, \App\Cache::LONG); |
|
47 | } |
|
48 | foreach ($widgetsData as $widgetData) { |
|
49 | if (!\in_array($widgetData['type'], ['RelatedModule', 'Updates', 'Comments'])) { |
|
50 | continue; |
@@ 109-114 (lines=6) @@ | ||
106 | */ |
|
107 | public function loadFieldsFromApi(): void |
|
108 | { |
|
109 | if (\App\Cache::has('moduleFields', $this->moduleName)) { |
|
110 | $data = \App\Cache::get('moduleFields', $this->moduleName); |
|
111 | } else { |
|
112 | $data = Api::getInstance()->call($this->moduleName . '/Fields'); |
|
113 | \App\Cache::save('moduleFields', $this->moduleName, $data); |
|
114 | } |
|
115 | $this->apiFields = $data; |
|
116 | } |
|
117 |