* get single report for user * @param int $id * @return array * @throws Exception */
(int $id)
| 139 | * @throws Exception |
| 140 | */ |
| 141 | public function readOwn(int $id) |
| 142 | { |
| 143 | $sql = $this->db->getQueryBuilder(); |
| 144 | $sql->from(self::TABLE_NAME) |
| 145 | ->select('*') |
| 146 | ->where($sql->expr()->eq('id', $sql->createNamedParameter($id))) |
| 147 | ->andWhere($sql->expr()->eq('user_id', $sql->createNamedParameter($this->userId))) |
| 148 | ->orderBy('parent', 'ASC') |
| 149 | ->addOrderBy('name', 'ASC'); |
| 150 | $statement = $sql->executeQuery(); |
| 151 | $result = $statement->fetch(); |
| 152 | $statement->closeCursor(); |
| 153 | |
| 154 | if ($result !== false) { |
| 155 | $result['dataset'] = (int) $result['dataset']; |
| 156 | $result['type'] = (int) $result['type']; |
| 157 | $result['parent'] = (int) $result['parent']; |
| 158 | $result['refresh'] = (int) $result['refresh']; |
| 159 | } |
| 160 | |
| 161 | return $result; |
| 162 | } |
| 163 | |
| 164 | /** |
| 165 | * get single report |
no outgoing calls
no test coverage detected