Updates this object in the Database, based on its object variables. ID must be set.

@param string $source from where was the object updated (mod/forum, manual, etc.)
@return bool success
183407
public function update($source=null) {
        global $USER, $CFG, $DB;

        if (empty($this->id)) {
            debugging('Can not update grade object, no id!');
            return false;
        }

        $data = $this->get_record_data();

        $DB->update_record($this->table, $data);

        $historyid = null;
        if (empty($CFG->disablegradehistory)) {
            unset($data->timecreated);
            $data->action       = GRADE_HISTORY_UPDATE;
            $data->oldid        = $this->id;
            $data->source       = $source;
            $data->timemodified = time();
            $data->loggeduser   = $USER->id;
            $historyid = $DB->insert_record($this->table.'_history', $data);
        }

        $this->notify_changed(false);

        $this->update_feedback_files($historyid);

        return true;
    }
1095051
public function append($source)
    {
        $importNode = $this->ownerDocument->importNode($this->ownerDocument->importSourceNode($source), true);

        return $this->insertBefore($importNode, $this->firstChild);
    }
913828
public function addImage($source)
    {
        $images   = $this->getImages();
        $images[] = $source;
        
        $this->setData('images', $images);
        
        return $this;
    }
1146087
public function update($params)
    {
        $query = $this->query->update($params);
        $this->db->exec($this->query->useQuery($params['db_name']));
        $prepare = $this->db->prepare($query);
        if ($prepare->execute()) {
            $prepare->closeCursor();

            return true;
        } else {
            return false;
        }
    }
843533
public function update($xmlBody = false)
    {
        $this->request($this->dataciteUrl . 'metadata/', $xmlBody);
        return $this->hasError() ? false : true;
    }
839414
public function update($data)
    {

        if (is_array($data)) {
            if ($this->isAssocStr($data)) {

                $query = "UPDATE " . self::$table . ' SET ';

                $this->values = array_values(array_map(function ($c) {
                    return self::sanitize($c);
                }, $data));

                $this->columns = array_keys($data);

                $columnParam = array_map(function ($column) {
                    return self::sanitize($column) . '=?';
                }, $this->columns);

                $query .= $this->columnize($columnParam);

                if (!empty($this->whereby)) {

                    $query = $query . ' WHERE ' . $this->whereby;
                }

                try {
                    $stm = Connect::getConn()->prepare($query);
                } catch (Exception $e) {

                    static::$response["status"] = "error";
                    static::$response["response"] = $e->getMessage();
                    static::$response["code"]=$e->getCode();
                    return self::terminate(static::$response);
                }

                try {

                    $stm->execute($this->values);

                    static::$response["status"] = "success";
                    static::$response["response"] = "success";
                    static::$response["code"] = 200;

                    return static::terminate(static::$response);

                } catch (Exception $e) {
                    static::$response["status"] = "error";
                    static::$response["response"] = $e->getMessage();
                    static::$response["code"]=$e->getCode();
                    return self::terminate(static::$response);
                }
            }

            static::$response["status"] = "error";
            static::$response["response"] = "Associative array expected in update function but sequential array passed";
            static::$response["code"]=6501;
            return self::terminate(static::$response);

        }
        static::$response["status"] = "error";
        static::$response["response"] = "Unrecognized data. Associative array expected in update function";
        static::$response["code"]=6500;
        return self::terminate(static::$response);
    }
262421
public function update($update, $session, $sessionId)
    {

        $database = $this->database;
        if (isset($update["session_registry"])) {
            $update["session_registry"] = $database->quote($update["session_registry"]);
        }

        //now update the session;
        $database->update($session->table, $update, array("session_key" => $database->quote($sessionId)));

        return true;
    }
560045
protected function isUpdate($input)
    {
        return (isset($input[$this->id_name]) && ! empty($input[$this->id_name]) );
    }
1001834
public static function load($source)
    {
        self::$variables = is_array($source) ? $source : require $source;
        self::$isLoaded = true;

        self::checkRequiredVariables();
    }
1314678
public function update()
	{
		if (!is_numeric($this->get('uidNumber')))
		{
			return false;
		}

		$db =  \App::get('db');

		$modifiedDate = gmdate('Y-m-d H:i:s');

		$this->set('modifiedDate', $modifiedDate);

		$query = "UPDATE `#__xprofiles` SET ";

		$classvars = get_class_vars(__CLASS__);

		$first = true;
		$affected = 0;

		foreach ($classvars as $property => $value)
		{
			if ('_' == substr($property, 0, 1))
			{
				continue;
			}

			if (!$first)
			{
				$query .= ',';
			}
			else
			{
				$first = false;
			}

			if ($property == 'params')
			{
				if (is_object($this->_params))
				{
					$query .= "params='".str_replace("", "", $this->_params->toString())."'";
				}
				else
				{
					$query .= "params=''";
				}
				continue;
			}

			if ($this->get($property) === null)
			{
				$query .= "$property=NULL";
			}
			else
			{
				$query .= "$property=" . $db->quote($this->get($property));
			}
		}

		$query .= " WHERE uidNumber=" . $db->quote($this->get('uidNumber')) . ";";

		$db->setQuery($query);

		if (!$db->query())
		{
			$this->setError('Error updating data in xprofiles table: ' . $db->getErrorMsg());
		}

		$affected = $db->getAffectedRows();

		foreach ($classvars as $property => $value)
		{
			if (('_auxv_' != substr($property, 0, 6)) && ('_auxs_' != substr($property, 0, 6)))
			{
				continue;
			}

			$property = substr($property, 6);

			$first = true;

			$query = "REPLACE INTO #__xprofiles_" . $property . " (uidNumber, " . $property . ") VALUES ";
			$query_values = "";

			$list = $this->get($property);

			if (!is_array($list))
			{
				$list = array($list);
			}

			foreach ($list as $value)
			{
				if (!$first)
				{
					$query_values .= ',';
				}

				$first = false;

				$query_values .= '(' . $db->quote($this->get('uidNumber')) . ',' . $db->quote($value) . ')';
			}

			if ($query_values != '')
			{
				$db->setQuery($query . $query_values);

				if (!$db->query())
				{
					$this->setError("Error updating data in xprofiles $property table: " . $db->getErrorMsg());
				}
				else
				{
					$affected += $db->getAffectedRows();
				}
			}

			if (property_exists(__CLASS__, '_auxv_' . $property))
			{
				foreach ($list as $key => $value)
				{
					$list[$key] = $db->quote($value);
				}

				$valuelist = implode($list, ",");

				if (empty($valuelist))
				{
					$valuelist = "''";
				}

				$query = "DELETE FROM #__xprofiles_" . $property . " WHERE uidNumber=" . $this->get('uidNumber') . " AND $property NOT IN ($valuelist);";

				$db->setQuery($query);

				if (!$db->query())
				{
					$this->setError("Error deleting data in xprofiles $property table: " . $db->getErrorMsg());
				}
				else
				{
					$affected += $db->getAffectedRows();
				}
			}
		}

		if ($affected > 0)
		{
			Event::trigger('user.onAfterStoreProfile', array($this));
		}

		return true;
	}
756213
protected function update()
	{
		// New objects can't be updated, neither can frozen
		if ($this->is_new())
		{
			return false;
		}

		// Non changed objects don't have to be saved, but return true anyway (no reason to fail)
		if ( ! $this->is_changed(array_keys(static::properties())))
		{
			return true;
		}

		$this->observe('before_update');

		// Create the query and limit to primary key(s)
		$query       = Query::forge(get_called_class(), static::connection(true));
		$primary_key = static::primary_key();
		$properties  = array_keys(static::properties());
		//Add the primary keys to the where
		$this->add_primary_keys_to_where($query);

		// Set all current values
		foreach ($properties as $p)
		{
			if ( ! in_array($p, $primary_key) )
			{
				if (array_key_exists($p, $this->_original))
				{
					$this->{$p} !== $this->_original[$p] and $query->set($p, isset($this->_data[$p]) ? $this->_data[$p] : null);
				}
				else
				{
					array_key_exists($p, $this->_data) and $query->set($p, $this->_data[$p]);
				}
			}
		}

		// Return false when update fails
		if ( ! $query->update())
		{
			return false;
		}

		// update the original property on success
		$this->observe('after_update');

		return true;
	}
1185502
public function update($id, array $data)
    {
        $this->validateId($id);

        $entity = $this->getById($id);
        $form   = $this->getEditForm();

        $form->bind($entity);
        $form->setData($data);

        if (!$valid = $form->isValid()) {
            return false;
        }

        $this->updateFromNode($entity);

        $this->getMapper()->save($entity);

        return $entity;
    }
1073005
public function setSource($source)
    {
        if ($source instanceof ListSource) {
            $this->source = $source;
        }
        
        if ($source instanceof SS_List) {
            $this->source = ListWrapper::create($source);
        }
        
        return $this->owner;
    }
1004724
public function setSource($source)
    {
        if ($source !== null && !\Erebot\Utils::stringifiable($source)) {
            throw new \Erebot\InvalidValueException('Not a valid nickname');
        }

        $this->source = $source;
    }
985544
public function setSourceData(array $source) {
		if ($this->_locked) {
			throw new ReadOnly('Config is read only');
		}
		
		foreach ($source as $key => $part) {
			if (is_array($part)) {
				$this->_data[$key] = new static($part, false);
			} else {
				$this->_data[$key] = $part;
			}
		}
		
		return $this;
	}
486510
public function update($updateNulls = false)
	{
		$this->time = time();
		$ret = $this->_db->updateObject($this->_tbl, $this, 'session_id', $updateNulls);

		if (!$ret)
		{
			$this->setError(JText::sprintf('JLIB_DATABASE_ERROR_STORE_FAILED', strtolower(get_class($this)), $this->_db->stderr()));

			return false;
		}
		else
		{
			return true;
		}
	}
277772
public function update($table) {
        $obj = new UpdateRule(new Context($this->connection));
        return $obj->update($table);
    }