* get single report * @param int $id * @return array * @throws Exception */
(int $id)
| 124 | * @throws Exception |
| 125 | */ |
| 126 | public function read(int $id) |
| 127 | { |
| 128 | $sql = $this->db->getQueryBuilder(); |
| 129 | $sql->from(self::TABLE_NAME) |
| 130 | ->select('*') |
| 131 | ->where($sql->expr()->eq('id', $sql->createNamedParameter($id))); |
| 132 | $statement = $sql->executeQuery(); |
| 133 | $result = $statement->fetch(); |
| 134 | $statement->closeCursor(); |
| 135 | |
| 136 | if ($result !== false) { |
| 137 | $result['type'] = (int) $result['type']; |
| 138 | $result['parent'] = (int) $result['parent']; |
| 139 | } |
| 140 | |
| 141 | return $result; |
| 142 | } |
| 143 | |
| 144 | /** |
| 145 | * update report |