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

Method reportsForDataset

lib/Db/ReportMapper.php:423–438  ·  view source on GitHub ↗

* reports for a dataset * @param $datasetId * @return array * @throws Exception */

($datasetId, ?string $ownerId = null)

Source from the content-addressed store, hash-verified

421 * @throws Exception
422 */
423 public function reportsForDataset($datasetId, ?string $ownerId = null)
424 {
425 $sql = $this->db->getQueryBuilder();
426 $sql->from(self::TABLE_NAME)
427 ->select('id')
428 ->addSelect('name')
429 ->addSelect('user_id')
430 ->where($sql->expr()->eq('dataset', $sql->createNamedParameter($datasetId)));
431 if ($ownerId !== null) {
432 $sql->andWhere($sql->expr()->eq('user_id', $sql->createNamedParameter($ownerId)));
433 }
434 $statement = $sql->executeQuery();
435 $result = $statement->fetchAll();
436 $statement->closeCursor();
437 return $result;
438 }
439
440 /**
441 * increase version for all reports of a dataset

Callers 1

deleteMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected