* update report options * @param $id * @param $chartoptions * @param $dataoptions * @param $filteroptions * @param $tableoptions * @return bool * @throws Exception */
($id, $chartoptions, $dataoptions, $filteroptions, $tableoptions, ?string $chart = null, ?string $visualization = null)
| 240 | * @throws Exception |
| 241 | */ |
| 242 | public function updateOptions($id, $chartoptions, $dataoptions, $filteroptions, $tableoptions, ?string $chart = null, ?string $visualization = null) |
| 243 | { |
| 244 | $sql = $this->db->getQueryBuilder(); |
| 245 | $sql->update(self::TABLE_NAME) |
| 246 | ->set('chartoptions', $sql->createNamedParameter($chartoptions)) |
| 247 | ->set('dataoptions', $sql->createNamedParameter($dataoptions)) |
| 248 | ->set('filteroptions', $sql->createNamedParameter($filteroptions)) |
| 249 | ->set('tableoptions', $sql->createNamedParameter($tableoptions)) |
| 250 | ->set('version', $sql->createFunction('COALESCE(version, 0) + 1')) |
| 251 | ->where($sql->expr()->eq('user_id', $sql->createNamedParameter($this->userId))) |
| 252 | ->andWhere($sql->expr()->eq('id', $sql->createNamedParameter($id))); |
| 253 | if ($chart !== null) { |
| 254 | $sql->set('chart', $sql->createNamedParameter($chart)); |
| 255 | } |
| 256 | if ($visualization !== null && in_array($visualization, ['chart', 'table', 'ct'], true)) { |
| 257 | $sql->set('visualization', $sql->createNamedParameter($visualization)); |
| 258 | } |
| 259 | $sql->executeStatement(); |
| 260 | return true; |
| 261 | } |
| 262 | |
| 263 | /** |
| 264 | * update report refresh interval |