* get reports by group * @param $groupId * @return array * @throws Exception */
($groupId)
| 392 | * @throws Exception |
| 393 | */ |
| 394 | public function getReportsByGroup($groupId) |
| 395 | { |
| 396 | $sql = $this->db->getQueryBuilder(); |
| 397 | $sql->from(self::TABLE_NAME) |
| 398 | ->select('*') |
| 399 | ->where($sql->expr()->eq('parent', $sql->createNamedParameter($groupId))); |
| 400 | $statement = $sql->executeQuery(); |
| 401 | $result = $statement->fetchAll(); |
| 402 | $statement->closeCursor(); |
| 403 | |
| 404 | if ($result !== false && is_array($result)) { |
| 405 | foreach ($result as &$row) { |
| 406 | $row['dataset'] = (int) $row['dataset']; |
| 407 | $row['type'] = (int) $row['type']; |
| 408 | $row['parent'] = (int) $row['parent']; |
| 409 | } |
| 410 | unset($row); // Unset reference |
| 411 | } |
| 412 | |
| 413 | return $result; |
| 414 | } |
| 415 | |
| 416 | /** |
| 417 | * reports for a dataset |