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

Method update

lib/Service/DataloadService.php:111–130  ·  view source on GitHub ↗

* update data load * * @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

109 * @return bool
110 */
111 public function update(int $dataloadId, $name, $option, $schedule, $storageMapping = null)
112 {
113 if (empty($this->DataloadMapper->readOwnById($dataloadId))) {
114 return false;
115 }
116 $array = json_decode($option, true);
117 foreach ($array as $key => $value) {
118 $array[$key] = htmlspecialchars($value, ENT_NOQUOTES, 'UTF-8');
119 }
120 $option = json_encode($array);
121
122 if (is_array($storageMapping)) {
123 $storageMapping = json_encode($storageMapping, JSON_THROW_ON_ERROR);
124 }
125 if ($storageMapping !== null && !is_array(json_decode((string)$storageMapping, true))) {
126 return false;
127 }
128
129 return $this->DataloadMapper->update($dataloadId, $name, $option, $schedule, $storageMapping);
130 }
131
132 /**
133 * copy a data load

Callers 4

executeMethod · 0.45
updateDataMethod · 0.45
importClipboardMethod · 0.45
importFileMethod · 0.45

Calls 1

readOwnByIdMethod · 0.80

Tested by

no test coverage detected