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

Method update

lib/Db/DataloadMapper.php:133–145  ·  view source on GitHub ↗

* update dataload * * @NoAdminRequired * @param int $dataloadId * @param $name * @param $option * @param $schedule * @return bool */

(int $dataloadId, $name, $option, $schedule, $storageMapping = null)

Source from the content-addressed store, hash-verified

131 * @return bool
132 */
133 public function update(int $dataloadId, $name, $option, $schedule, $storageMapping = null) {
134 $name = $this->truncate($name, 64);
135 $sql = $this->db->getQueryBuilder();
136 $sql->update(self::TABLE_NAME)->set('name', $sql->createNamedParameter($name))
137 ->set('option', $sql->createNamedParameter($option))->set('schedule', $sql->createNamedParameter($schedule))
138 ->where($sql->expr()->eq('user_id', $sql->createNamedParameter($this->userId)))->andWhere($sql->expr()
139 ->eq('id', $sql->createNamedParameter($dataloadId)));
140 if ($storageMapping !== null) {
141 $sql->set('storage_mapping', $sql->createNamedParameter($storageMapping));
142 }
143 $sql->executeStatement();
144 return true;
145 }
146
147 /**
148 * copy a data load

Callers

nothing calls this directly

Calls 3

truncateMethod · 0.95
setMethod · 0.80
eqMethod · 0.80

Tested by

no test coverage detected