public function save()
{
$this->db->Execute("INSERT INTO farm_role_storage_config SET\n id = ?,\n farm_role_id = ?,\n `index` = ?,\n `type` = ?,\n fs = ?,\n re_use = ?,\n rebuild = ?,\n mount = ?,\n mountpoint = ?,\n label = ?,\n mount_options = ?,\n status = ?\n ON DUPLICATE KEY UPDATE `index` = ?, `type` = ?, fs = ?, re_use = ?, `rebuild` = ?, mount = ?, mountpoint = ?, label = ?, mount_options = ?, status = ?\n ", array($this->id, $this->farmRole->ID, $this->index, $this->type, $this->fs, $this->reUse, $this->rebuild, $this->mount, $this->mountPoint, $this->label, $this->mountOptions, $this->status, $this->index, $this->type, $this->fs, $this->reUse, $this->rebuild, $this->mount, $this->mountPoint, $this->label, $this->mountOptions, $this->status));
$this->db->Execute('DELETE FROM farm_role_storage_settings WHERE storage_config_id = ?', array($this->id));
if (count($this->settings)) {
$query = array();
$args = array();
foreach ($this->settings as $key => $value) {
$query[] = '(?,?,?)';
$args[] = $this->id;
$args[] = $key;
$args[] = $value;
}
$this->db->Execute('INSERT INTO farm_role_storage_settings (storage_config_id, name, value) VALUES ' . implode(',', $query), $args);
}
}