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

Method read

lib/Service/ShareService.php:112–127  ·  view source on GitHub ↗

* get all shares for a report or panorama * * @param $item_source * @param $item_type * @return array * @throws Exception */

($item_type, $item_source)

Source from the content-addressed store, hash-verified

110 * @throws Exception
111 */
112 public function read($item_type, $item_source) {
113
114 $shares = $this->ShareMapper->getShares($item_type, $item_source);
115 foreach ($shares as $key => $share) {
116 if ((int)$share['type'] === self::SHARE_TYPE_USER) {
117 if (!$this->userManager->userExists($share['uid_owner'])) {
118 $this->ShareMapper->deleteShare($share['id']);
119 unset($shares[$key]);
120 continue;
121 }
122 $shares[$key]['displayName'] = $this->userManager->get($share['uid_owner'])->getDisplayName();
123 }
124 $shares[$key]['pass'] = $share['pass'] !== null;
125 }
126 return $shares;
127 }
128
129 /**
130 * get all report by token

Callers 1

Calls 5

getSharesMethod · 0.45
userExistsMethod · 0.45
deleteShareMethod · 0.45
getDisplayNameMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected