Update the database
516591
def update(connection, silent, hgnc_file_path, hcop_file_path, low_memory):
    """"""
    database.update(connection=connection,
                    silent=silent,
                    hgnc_file_path=hgnc_file_path,
                    hcop_file_path=hcop_file_path,
                    low_memory=low_memory)
44838
protected function update() {
        if(Auth::isAdmin()){
            $ihooks = HookProvider::getInstance()->getInstalledHooks();
            	
            $module_names= Database::prepare(
                "SELECT module_name FROM `##module` WHERE status='disabled'"
            )->fetchOneColumn();
            	
            if($ihooks !== null){
                foreach ($ihooks as $ihook => $params) {
                    if(Filter::post('hook-' . $params['id']) === 'yes') {                    
                        $array_hook = explode('#', $ihook);
                        //Update status
                        $new_status= Filter::postBool('status-' . $params['id']);
                        if(in_array($array_hook[0], $module_names)) $new_status = false;
                        $previous_status = $params['status'];
                        if ($new_status !== null) {
                            $new_status= $new_status ? 'enabled' : 'disabled';
                            if($new_status != $previous_status){
                                $chook = new Hook($array_hook[1], $array_hook[2]);
                                switch($new_status){
                                    case 'enabled':
                                        $chook->enable($array_hook[0]);
                                        break;
                                    case 'disabled':
                                        $chook->disable($array_hook[0]);
                                        break;
                                    default:
                                        break;
                                }
                            }
                        }
                        
                        //Update priority
                        $new_priority = Filter::postInteger("moduleorder-{$params['id']}");
                        $previous_priority = $params['priority'];
                        if ($new_priority !== null) {
                            if($new_priority != $previous_priority){
                                $chook = new Hook($array_hook[1], $array_hook[2]);
                                $chook->setPriority($array_hook[0], $new_priority);
                            }
                        }
                    }
                }
            }
        }
    }
535940
def update(self, *args, **kwargs):
        """"""
        for system in self.systems:
            system.update(self, *args, **kwargs)
327230
public function updatePrimaryDbValueFromDbData()
    {
        $dbDataPrimaryValue = $this->getDbDataPrimaryValue();

        if ($dbDataPrimaryValue !== $this->getDbDataPrimaryDefaultValue()) {
            $this->setPrimaryDbValue($dbDataPrimaryValue);
        }
    }
931521
function Update()
	{
		$db = $this->DB();
		if (!$db) {
			return false;
		}
		$table = $this->TableInfo();

		$where = $this->GenWhere($db, $table);

		if (!$where) {
			$this->error("Where missing for table $table", "Update");
			return false;
		}
		$valarr = array();
		$neworig = array();
		$pairs = array();
		$i = -1;
		$cnt = 0;
		foreach($table->flds as $name=>$fld) {
			$i += 1;
			$val = $this->$name;
			$neworig[] = $val;

			if (isset($table->keys[$name])) {
				continue;
			}

			if (is_null($val)) {
				if (isset($fld->not_null) && $fld->not_null) {
					if (isset($fld->default_value) && strlen($fld->default_value)) {
						continue;
					}
					else {
						$this->Error("Cannot set field $name to NULL","Update");
						return false;
					}
				}
			}

			if (isset($this->_original[$i]) && $val === $this->_original[$i]) {
				continue;
			}
			$valarr[] = $val;
			$pairs[] = $name.'='.$db->Param($cnt);
			$cnt += 1;
		}


		if (!$cnt) {
			return -1;
		}
		$sql = 'UPDATE '.$this->_table." SET ".implode(",",$pairs)." WHERE ".$where;
		$ok = $db->Execute($sql,$valarr);
		if ($ok) {
			$this->_original = $neworig;
			return 1;
		}
		return 0;
	}
971764
function update()
    {
        $old = Eresus_CMS::getLegacyKernel()->sections->get(arg('update', 'int'));
        $item = $old;

        $newName = arg('name', '/[^a-z0-9_]/i');
        if ($newName)
        {
            $item['name'] = $newName;
        }
        $item['title'] = arg('title', 'dbsafe');
        $item['caption'] = arg('caption', 'dbsafe');
        $item['description'] = arg('description', 'dbsafe');
        $item['hint'] = arg('hint', 'dbsafe');
        $item['keywords'] = arg('keywords', 'dbsafe');
        $item['template'] = arg('template', 'dbsafe');
        $item['type'] = arg('type', 'dbsafe');
        $item['active'] = arg('active', 'int');
        $item['visible'] = arg('visible', 'int');
        $item['access'] = arg('access', 'int');
        $item['position'] = arg('position', 'int');
        $item['options'] = text2array(arg('options'), true);

        $temp = Eresus_CMS::getLegacyKernel()->sections->get("(`name`='" . $item['name'] .
        "') AND (`owner`='" . $item['owner'] . "' AND `id` <> " . $item['id'] . ")");
        if (count($temp) > 0)
        {
            Eresus_Kernel::app()->getPage()->addErrorMessage(
                sprintf(errItemWithSameName, $item['name']));
            saveRequest();
            HTTP::redirect(Eresus_CMS::getLegacyKernel()->request['referer']);
        }

        if (arg('created'))
        {
            $item['created'] = arg('created', 'dbsafe');
        }
        $item['updated'] = arg('updated', 'dbsafe');
        if (arg('updatedAuto'))
        {
            $item['updated'] = gettime('Y-m-d H:i:s');
        }

        Eresus_CMS::getLegacyKernel()->sections->update($item);

        HTTP::redirect(arg('submitURL'));
    }
1197567
public function update()
    {
        self::$instance->reset();
        $this->sql('UPDATE');

        $numargs = func_num_args();

        if ($numargs > 0) {
            $arg_list = func_get_args();

            $this->oosql_multiFlag = true;

            $this->oosql_multi = $arg_list;

            for ($i = 0; $i < $numargs; $i++) {
                if ($i != 0 && $numargs > $i) {
                    $this->sql(',');
                }
                $this->sql(' ' . $arg_list[$i]);
            }
        } else {
            $this->sql(" $this->oosql_table");
        }

        $this->sql(' SET ');
        $this->oosql_where = null;
        return $this;
    }
1203467
def update(self, *args, **kwargs):
        

        dict.update(self, *args, **kwargs)
        self.__dict__.update(*args, **kwargs)
27516
public function up() {
		$db = Database::get();
		$db->query("
			ALTER TABLE `file`
			ADD `path` varchar(128) COLLATE 'utf8_unicode_ci' NOT NULL AFTER `name`;
		", []);

		$data = $db->get_all('SELECT * FROM file WHERE path = "" AND md5sum != ""', []);
		foreach ($data as $row) {
			$path = $this->get_path($row);
			$db->query('UPDATE file SET path=? WHERE id=?', [ $path, $row['id'] ]);
		}
	}
122831
def update(self,table, sys_id, **kparams):
        
        record = self.api.update(table, sys_id, **kparams)
        return record
4560
def update(self, **kwargs):
        
        data = kwargs.get('data')
        if data is not None:
            if (util.pd and isinstance(data, util.pd.DataFrame) and
                list(data.columns) != list(self.data.columns) and self._index):
                data = data.reset_index()
            self.verify(data)
            kwargs['data'] = self._concat(data)
            self._count += 1
        super(Buffer, self).update(**kwargs)
55690
private function update ()
	{
		$this->before_update();

		$statement = 'UPDATE ' . static::$table_name . ' SET ';

		$sets = [];
		$values = [];

		foreach ($this->storage as $key => $value) {
			if ($value !== null) {
				$sets[] = $this->db->quote_column($key) . ' = ?';
				$values[] = $value;
			}
		}

		$statement .= implode(', ', $sets);

		$pk = $this->primary_key_condition();

		$statement .= ' WHERE ' . $pk->statement;

		$values = array_merge($values, $pk->values->getArrayCopy());

		$result = $this->db->query($statement, $values, 'multi', null, false);

		$this->stored = true;
		$this->updated = false;

		$this->after_update();

		return true;
	}
1059870
function update() {
		$args=[];
		$ctr=0;
		$pairs='';
		$filter='';
		$pkeys=[];
		foreach ($this->fields as $key=>$field)
			if ($field['pkey'])
				$pkeys[$key]=$field['previous'];
		if (isset($this->trigger['beforeupdate']) &&
			\Base::instance()->call($this->trigger['beforeupdate'],
				[$this,$pkeys])===FALSE)
			return $this;
		foreach ($this->fields as $key=>$field)
			if ($field['changed']) {
				$pairs.=($pairs?',':'').$this->db->quotekey($key).'=?';
				$args[++$ctr]=[$field['value'],$field['pdo_type']];
			}
		foreach ($this->fields as $key=>$field)
			if ($field['pkey']) {
				$filter.=($filter?' AND ':' WHERE ').
					$this->db->quotekey($key).'=?';
				$args[++$ctr]=[$field['previous'],$field['pdo_type']];
			}
		if ($pairs) {
			$sql='UPDATE '.$this->table.' SET '.$pairs.$filter;
			$this->db->exec($sql,$args);
		}
		if (isset($this->trigger['afterupdate']))
			\Base::instance()->call($this->trigger['afterupdate'],
				[$this,$pkeys]);
		// reset changed flag after calling afterupdate
		foreach ($this->fields as $key=>&$field) {
				$field['changed']=FALSE;
				$field['initial']=$field['value'];
				unset($field);
			}
		return $this;
	}
1264551
def update(self, *args, **kwargs):
        
        if args:
            self.database.hmset(self.key, *args)
        else:
            self.database.hmset(self.key, kwargs)
732261
private function update_dict()
    {
        if (strcasecmp($this->options['dictionary'], 'shared') != 0) {
            $userid = $this->rc->get_user_id();
        }

        $plugin = $this->rc->plugins->exec_hook('spell_dictionary_save', array(
            'userid' => $userid, 'language' => $this->lang, 'dictionary' => $this->dict));

        if (!empty($plugin['abort'])) {
            return;
        }

        if ($this->have_dict) {
            if (!empty($this->dict)) {
                $this->rc->db->query(
                    "UPDATE " . $this->rc->db->table_name('dictionary', true)
                    ." SET `data` = ?"
                    ." WHERE `user_id` " . ($plugin['userid'] ? "= ".$this->rc->db->quote($plugin['userid']) : "IS NULL")
                        ." AND `language` = ?",
                    implode(' ', $plugin['dictionary']), $plugin['language']);
            }
            // don't store empty dict
            else {
                $this->rc->db->query(
                    "DELETE FROM " . $this->rc->db->table_name('dictionary', true)
                    ." WHERE `user_id` " . ($plugin['userid'] ? "= ".$this->rc->db->quote($plugin['userid']) : "IS NULL")
                        ." AND `language` = ?",
                    $plugin['language']);
            }
        }
        else if (!empty($this->dict)) {
            $this->rc->db->query(
                "INSERT INTO " . $this->rc->db->table_name('dictionary', true)
                ." (`user_id`, `language`, `data`) VALUES (?, ?, ?)",
                $plugin['userid'], $plugin['language'], implode(' ', $plugin['dictionary']));
        }
    }
882697
def update(self):
        '''
        
        '''
        self._json = self._request(
            method='GET',
            url=self.API
        )._json
1156396
public function update()
    {
        $this->left = $this->x;
        $this->right = $this->x + $this->width;
        $this->top = $this->y;
        $this->bottom = $this->y + $this->height;
    }