MCPcopy Create free account
hub / github.com/Rello/analytics / read

Method read

lib/Service/PanoramaService.php:112–126  ·  view source on GitHub ↗

* get own report details * falls back to panoramas shared with the current user * * @param int $panoramaId * @return array * @throws Exception */

(int $panoramaId)

Source from the content-addressed store, hash-verified

110 * @throws Exception
111 */
112 public function read(int $panoramaId) {
113 $ownReport = $this->PanoramaMapper->readOwn($panoramaId);
114 if ($ownReport) {
115 $ownReport['permissions'] = \OCP\Constants::PERMISSION_UPDATE;
116 } else {
117 $sharedPanorama = $this->ShareService->getSharedPanorama($panoramaId);
118 if (!empty($sharedPanorama)) {
119 // ToDo: panoramas do not have an edit logic. to be added later
120 $sharedPanorama['permissions'] = \OCP\Constants::PERMISSION_READ;
121 $keysToKeep = array('id', 'name', 'dataset', 'favorite', 'parent', 'type', 'pages', 'filters', 'isShare', 'shareId', 'permissions');
122 $ownReport = array_intersect_key($sharedPanorama, array_flip($keysToKeep));
123 }
124 }
125 return $ownReport;
126 }
127
128 /**
129 * Resolve a selected panorama picture to its file id.

Callers

nothing calls this directly

Calls 2

getSharedPanoramaMethod · 0.80
readOwnMethod · 0.45

Tested by

no test coverage detected