Fetches the result of a report

@param int $reportID Report identifier

@return array

@throws Exception on error
428381
public function read($reportID) {
        $result = $this->api->request(
            'cmdb.reports',
            [
                'id' => $reportID
            ]
        );

        if (!is_array($result)) {
            return [];
        }

        return $result;
    }
985234
public function read($callId, $legId, $recordingId, $transcriptionId)
    {
        list(, , $body) = $this->HttpClient->performHttpRequest(Common\HttpClient::REQUEST_GET,
            "calls/$callId/legs/$legId/recordings/$recordingId/transcriptions/$transcriptionId");

        return $this->processRequest($body);
    }
1085397
public static function color($colorID)
    {
        if (!in_array($colorID, static::getKnownColors())) {
            throw new Exception("Unknown color ID $colorID");
        }

        $colorClass = static::getColorClass();

        $color = new $colorClass($colorID);

        return $color;
    }
950854
public function load($paymentId)
    {
        $db = $this->getDb();
        $data = $db->getRow('SELECT * FROM `oepaypal_orderpayments` WHERE `oepaypal_paymentid` = ' . $db->quote($paymentId));

        return $data;
    }
416273
public function get($lineId)
    {
        foreach ($this as $line) {
            if ($line->id === $lineId) {
                return $line;
            }
        }
        return null;
    }
92202
public function result($id): array
    {
        $options = ['query' => ['id' => $id]];

        /** @var JsonStream $stream */
        $stream = $this->client
            ->get(UserApi::generateUrl('csv/result.json'), $options)
            ->getBody();

        return $stream->jsonSerialize();
    }
1183182
public function batchRead(array $reportIDs) {
        $requests = [];

        foreach ($reportIDs as $reportID) {
            $requests[] = [
                'method' => 'cmdb.reports',
                'params' => [
                    'id' => $reportID
                ]
            ];
        }

        $batchResults = $this->api->batchRequest($requests);
        $results = [];

        foreach ($batchResults as $result) {
            if (is_array($result)) {
                $results[] = $result;
            } else {
                $results[] = [];
            }
        }

        return $results;
    }
701346
public function clientGetByDbid($dbid)
  {
    foreach($this->clientList() as $client)
    {
      if($client["client_database_id"] == $dbid) return $client;
    }

    throw new Exception("invalid clientID", 0x200);
  }
1122612
public function get(int $groupId, int $begin, int $count)
    {
        $params = [
            'group_id' => $groupId,
            'begin' => $begin,
            'count' => $count,
        ];

        return $this->httpPostJson('shakearound/device/group/getdetail', $params);
    }
387262
public function getEventAlbums($eventId)
    {
        if (is_null($eventId) || $eventId == '') {
            throw new Exception('The eventId is required to check if a photo exists.');
        }

        $params = array(
            'method' => 'sp.album.get_list',
            'event_id' => $eventId
        );

        return $this->_makeApiRequest($params);
    }
392357
public function retrieve($notificationId)
    {
        $response = $this->sendRequest(
            self::METHOD_GET,
            str_replace(':notification_id', $notificationId, self::$endPoints['retrieve']),
            $this->requestData
        );
        $this->resetRequestData();
        return $response;
    }
297565
public function getResult()
    {
        $result = parent::getResult();
        if (is_array($result) && isset($result['error'])) {
            throw new Exception($result['error']);
        }
        return $result;
    }
1341309
public function findById($id)
    {
        if( is_null($id)) {
            throw new \Exception('ID is required');
        }

        try {
            $role = $this->getRepository('\erdiko\users\entities\Role');
            $result = $role->find($id);
        }catch (\Exception $e) {
            \error_log($e->getMessage());
        }
        return $result;
    }
1327516
public function find($id)
    {
        $response = $this->client->request('GET', sprintf('/%s/%s', $this->name, $id));
        $json = (string) $response->getBody();

        if (404 === $response->getStatusCode()) {
            throw new Exception('Document does not exist');
        }

        return JSONEncoder::decode($json);
    }
1354420
protected function extractResult()
    {
        if (!$this->getQuery()) {
            throw new \Exception(sprintf(
                'No defined query from %s. Did you forget to call method %s ?',
                Query::class,
                '"setQuery()"'
            ));
            exit;
        }

        $arrayResult = $this->getArrayResult();

        if (isset($arrayResult['error']) && isset($arrayResult['message']) && $arrayResult['error'] === true) {
            $this->getQuery()->getError()->setMessage($arrayResult['message']);
        } elseif (isset($arrayResult['response']) && $arrayResult['response']) {
            $response = $arrayResult['response'];
            $resultDataType = $this->getQuery()->getResultDataType();

            foreach ($response as $index => $result) {
                $sql = $this->getQuery()->addOrReplace($index, $result['string']);
                $sqlResult = $sql->getResult();

                if ($resultDataType instanceof DataInterface) {
                    $sqlResult->setDataType($resultDataType);
                }

                $sql->execute($result['executed']);
                $insertId = $result['result']['insertId'];

                $sqlResult->setColumnTypes($result['result']['types']);
                $sqlResult->setStart($result['result']['start']);
                $sqlResult->setEnd($result['result']['end']);
                $sqlResult->setAffected($result['result']['affected']);
                $sqlResult->setStartRow($result['result']['startRow']);
                $sqlResult->setTotalRows($result['result']['totalRows']);
                $sqlResult->setTotalShows($result['result']['totalShows']);
                $sqlResult->setInsertId(is_numeric($insertId) ? floatval($insertId) : $insertId);

                foreach ($result['result']['data'] as $data) {
                    if (!is_array($sqlResult->getDataType())) {
                        $item = $sqlResult->getDataType();
                        foreach ($data as $key => $value) {
                            $item->set($key, $value);
                        }
                        $data = $item;
                    }
                    $sqlResult->add($data);
                }
            }

            $this->getQuery()->removeFromIndex(count($response));
        }

        return $this->getQuery();
    }
658977
protected function fetchProject($projectId, $expectedType)
    {
        $project = $this->projectStore->getById($projectId);

        if (empty($project)) {
            throw new Exception('Project does not exist: ' . $projectId);
        }

        if (is_array($expectedType)
            ? !in_array($project->getType(), $expectedType)
            : $project->getType() !== $expectedType
        ) {
            throw new Exception('Wrong project type: ' . $project->getType());
        }

        return $project;
    }
479753
public function get($profileId, $reportId, $optParams = array()) {
      $params = array('profileId' => $profileId, 'reportId' => $reportId);
      $params = array_merge($params, $optParams);
      $data = $this->__call('get', array($params));
      if ($this->useObjects()) {
        return new Report($data);
      } else {
        return $data;
      }
    }