Performs the actual update, and calls all callbacks.

This method returns true or false depending on if the operation was
successful.

@return bool
775571
public function commit()
    {
        // First we validate if every property has a handler
        foreach ($this->mutations as $propertyName => $value) {
            if (!isset($this->result[$propertyName])) {
                $this->failed = true;
                $this->result[$propertyName] = 403;
            }
        }

        foreach ($this->propertyUpdateCallbacks as $callbackInfo) {
            if ($this->failed) {
                break;
            }
            if (is_string($callbackInfo[0])) {
                $this->doCallbackSingleProp($callbackInfo[0], $callbackInfo[1]);
            } else {
                $this->doCallbackMultiProp($callbackInfo[0], $callbackInfo[1]);
            }
        }

        /*
         * If anywhere in this operation updating a property failed, we must
         * update all other properties accordingly.
         */
        if ($this->failed) {
            foreach ($this->result as $propertyName => $status) {
                if (202 === $status) {
                    // Failed dependency
                    $this->result[$propertyName] = 424;
                }
            }
        }

        return !$this->failed;
    }
1351052
protected function executeCallbacks()
	{
		if ($this->callbacks_executed) {
			return;
		}
		
		$this->callbacks_executed = true;
		
		foreach ($this->callbacks as $callback) {
			if ($q = call_user_func($callback, $this->query)) {
				$this->query = $q;
			}
		}
	}
1166003
public function apply()
    {
        $updates = [];
        $update_file = DIR_CONFIG_SITE . '/update.php';
        if (file_exists($update_file)) {
            if (!is_writable($update_file)) {
                return self::E_UPDATE_WRITE_CONFIG;
            }
            $updates = (array) include $update_file;
        }

        $updates['core'] = $this->getUpdateIdentifier();
        \Config::clear('concrete.version');

        $renderer = new Renderer($updates);
        file_put_contents($update_file, $renderer->render());
        OpCache::clear($update_file);

        return true;
    }
855446
public function getAllUpdates()
	{
		$update =  !empty($_SESSION[$this->_app->name]['update']) ? $_SESSION[$this->_app->name]['update'] : false;

		// Clean em all!
		$this->cleanUpdate();

		return $update;
	}
956450
public function update()
	{
		// temporary disable relations
		$tmp_relations   = $this->relations;
		$this->relations = array();

		// Build query and execute update
		$query = \DB::update(call_user_func($this->model.'::table'));
		$tmp   = $this->build_query($query, array(), 'update');
		$query = $tmp['query'];
		$res = $query->set($this->values)->execute($this->write_connection);

		// put back any relations settings
		$this->relations = $tmp_relations;

		// Update can affect 0 rows when input types are different but outcome stays the same
		return $res >= 0;
	}
234506
public function execute()
    {
        if (!$this->tryAndProcessRules()) {
            return false;
        }

        $phpmdBinaryPath = $this->phpci->findBinary('phpmd');

        $this->executePhpMd($phpmdBinaryPath);

        $errorCount = $this->processReport(trim($this->phpci->getLastOutput()));
        $this->build->storeMeta('phpmd-warnings', $errorCount);

        return $this->wasLastExecSuccessful($errorCount);
    }
1196945
public function update()
    {
        $sync = !empty($this->request->query['sync']) ? true : false;
        if (AcoManager::buildAcos(null, $sync)) {
            $this->Flash->success(__d('user', 'Permissions tree was successfully updated!'));
        } else {
            $this->Flash->danger(__d('user', 'Some errors occur while updating permissions tree.'));
        }

        $this->title(__d('user', 'Update Permissions'));
        $this->redirect($this->referer());
    }
1136221
public function update()
    {
        // copy the code into memory
        $backup = file($this->reflection->getFileName());

        list($preamble, $class) = $this->splitClassFile($backup);
        $preamble = $this->stripOutExistingDocBlock($preamble);
        $preamble .= $this->buildUpdatedDocBlock();

        if ($this->writeClassFile(implode(PHP_EOL, [$preamble, $class]))
            && $this->commandLineLint($this->reflection->getFileName())
        ) {
            return true;
        }

        $this->writeClassFile(implode('', $backup));
        return false;
    }
528059
public function poll()
    {
        if ($this->completed || !$this->hasStarted()) {
            return false;
        }

        if ($this->process->isRunning()) {
            if ($this->updateOnPoll) {
                $this->dispatch(RunEvent::UPDATED, new RunEvent($this));
            }
            return true;
        }

        $this->completed = true;
        $this->setFinished();

        if ($this->process->isSuccessful()) {
            $this->successful = true;
            $this->dispatch(RunEvent::SUCCESSFUL, new RunEvent($this));
        } else {
            $this->dispatch(RunEvent::FAILED, new RunEvent($this));
        }
        $this->dispatch(RunEvent::COMPLETED, new RunEvent($this));

        return false;
    }
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;
    }
813124
public function hasOnUpdate()
    {
        $database = $this->getTable()->getDatabase();
        if($database instanceof Database &&
               $this->onUpdate === $database->getPlatform()->getDefaultFKOnUpdateBehavior()) {
          return false;
        }

        return ($this->onUpdate !== self::NONE);
    }
626599
public function update()
    {
        $args    = func_get_args();
        $order = null;

        if (count($args) == 1 && $args[0] instanceof Order) {
            $order = $args[0];
        } elseif (count($args) == 2 && !empty($args[0]) && is_array($args[1])) {
            $order = $this->find($args[0]);
            $order->fill($args[1]);
        }

        if ($order instanceof Order) {
            if ($this->fireEvent('updating', array($order)) === false) {
                return false;
            }

            $order->setCaller($this);
            $order->save();

            $this->fireEvent('updated', array($order));

            return $order;
        }

        throw new Exception(sprintf(Exception::CANT_UPDATE_MODEL,
            'Subbly\\Model\\Order',
            $this->name()
        ));
    }
1158100
public function update()
    {
        // convert to criteria.
        $args = func_get_args();
        $attributes = array_shift($args);
        $criteria = call_user_func_array(array($this, 'argsToCriteria'), $args);

        // to SQL.
        $sql = $criteria->toUpdateSQL($attributes);

        // query.
        $sth = $this->query($sql, $criteria->getParams(), Database::TARGET_MASTER);
        return $sth->isSuccess();
    }
553852
protected function _update()
    {
        $this->oxnews__oxdate->setValue(\OxidEsales\Eshop\Core\Registry::getUtilsDate()->formatDBDate($this->oxnews__oxdate->value, true));

        parent::_update();
    }
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;
	}
1281021
public function update()
        {
                $ok = true;

                // perform updates...
                $ok = $this->updateFile(self::FILENAME_RULES);

                if ($ok)
                        $ok = $this->updateFile(self::FILENAME_CONVERTER);

                return $ok;
        }
656950
public function update()
    {
        if ($this->newVersionAvailable === false
        || (!is_bool($this->newVersionAvailable) && !$this->hasUpdate())) {
            return false;
        }
        $this->backupPhar();
        $this->downloadPhar();
        $this->replacePhar();
        return true;
    }