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

Method updateOptions

lib/Db/ReportMapper.php:242–261  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

setMethod · 0.80
eqMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected