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

Method update

lib/Service/PanoramaService.php:196–212  ·  view source on GitHub ↗

* update report details * * @param int $id * @param $name * @param $subheader * @param int $type * @param int $parent * @param $pages * @return bool * @throws Exception */

(int $id, $name, int $type, int $parent, $pages, $filters = null)

Source from the content-addressed store, hash-verified

194 * @throws Exception
195 */
196 public function update(int $id, $name, int $type, int $parent, $pages, $filters = null) {
197 if (!$this->isOwn($id) || !$this->isValidParent($parent, $id)) {
198 return false;
199 }
200 $normalizedPages = $this->normalizePages($pages);
201 if ($normalizedPages === null) {
202 return false;
203 }
204 if ($filters !== null) {
205 try {
206 $filters = json_encode(PanoramaFilterService::normalize($filters, $normalizedPages));
207 } catch (\InvalidArgumentException $e) {
208 return false;
209 }
210 }
211 return $this->PanoramaMapper->update($id, $name, $type, $parent, json_encode($normalizedPages), $filters);
212 }
213
214 public function createGroup(int $parent = 0): int {
215 if (!$this->isValidParent($parent)) {

Callers

nothing calls this directly

Calls 4

isOwnMethod · 0.95
isValidParentMethod · 0.95
normalizePagesMethod · 0.95
normalizeMethod · 0.45

Tested by

no test coverage detected