* get own reports which are marked as favorites * * @return array|bool * @throws Exception */
()
| 275 | * @throws Exception |
| 276 | */ |
| 277 | public function getOwnFavoriteReports() { |
| 278 | $ownReports = $this->PanoramaMapper->index(); |
| 279 | //$sharedReports = $this->ShareService->getSharedItems(ShareService::SHARE_ITEM_TYPE_REPORT); |
| 280 | $sharedReports = []; |
| 281 | $favorites = $this->tagManager->load('analyticsPanorama')->getFavorites(); |
| 282 | |
| 283 | // remove the favorite if the report is not existing anymore |
| 284 | foreach ($favorites as $favorite) { |
| 285 | if (!in_array($favorite, array_column($ownReports, 'id')) && !in_array($favorite, array_column($sharedReports, 'id'))) { |
| 286 | unset($favorites[$favorite]); |
| 287 | $this->removeFavoriteTag('analyticsPanorama', $favorite); |
| 288 | } |
| 289 | } |
| 290 | return $favorites; |
| 291 | } |
| 292 | |
| 293 | /** |
| 294 | * set/remove the favorite flag for a report |
nothing calls this directly
no test coverage detected