Update a geodispersion analysis in the database, in transactional manner.
When successful, returns the updated GeoAnalysis object

@param GeoAnalysis $ga
@return GeoAnalysis
199095
public function updateGeoAnalysis(GeoAnalysis $ga) {
        try {
			Database::beginTransaction();
		
			Database::prepare(
				'UPDATE `##maj_geodispersion`'.
				' SET majgd_descr = :description,'.
				' majgd_sublevel = :analysis_level,'.
				' majgd_map = :map,'.
				' majgd_toplevel = :map_top_level,'.
				' majgd_useflagsgen = :use_flags,'.
				' majgd_detailsgen = :gen_details'.
				' WHERE majgd_file = :gedcom_id AND majgd_id = :ga_id'
			)->execute(array(
				'gedcom_id' => $this->tree->getTreeId(),
				'ga_id' => $ga->getId(),
				'description' => $ga->getTitle(),
				'analysis_level' => $ga->getAnalysisLevel(),
				'use_flags' => $ga->getOptions() && $ga->getOptions()->isUsingFlags() ? 'yes' : 'no',
				'gen_details' => $ga->getOptions() ? $ga->getOptions()->getMaxDetailsInGen() : 0,
				'map' => $ga->hasMap() ? $ga->getOptions()->getMap()->getFileName() : null,
				'map_top_level' => $ga->hasMap() ? $ga->getOptions()->getMapLevel() : -100        
			));
			
			$ga = $this->getGeoAnalysis($ga->getId(), false);
			
			 Database::commit();
		}
		catch(\Exception $ex) {		    
			Database::rollback();
			Log::addErrorLog('The Geo Analysis ID “' . $ga->getId() . '” failed to be updated. Transaction rollbacked. Exception: '.$ex->getMessage());
			$ga = null;
		}
		return $ga;
    }
1145356
public function updatedAt()
    {
        $updatedAt = array_get($this->data, 'updated_at', null);

        if ($updatedAt === null) {
            return trans('gzero-core::common.unknown');
        }

        return $updatedAt;
    }
1018614
public function updateGeoIp()
    {
        $updater = new GeoIpUpdater();

        $success = $updater->updateGeoIpFiles($this->config->get('geoip_database_path'));

        $this->messageRepository->addMessage($updater->getMessages());

        return $success;
    }
1313344
public static function updateBetsFromGame(Game $game) {
    $bets = $game->getBets();
    $points = $game->getLeague()->getPoints();
    foreach ($bets as $bet) {
      self::updateBetFromGame($bet, $game, $points);
    }
  }
1115548
@Override
	public int update(GeometryIndex geometryIndex) throws SQLException {

		UpdateBuilder<GeometryIndex, GeometryIndexKey> ub = updateBuilder();
		ub.updateColumnValue(GeometryIndex.COLUMN_MIN_X,
				geometryIndex.getMinX());
		ub.updateColumnValue(GeometryIndex.COLUMN_MAX_X,
				geometryIndex.getMaxX());
		ub.updateColumnValue(GeometryIndex.COLUMN_MIN_Y,
				geometryIndex.getMinY());
		ub.updateColumnValue(GeometryIndex.COLUMN_MAX_Y,
				geometryIndex.getMaxY());
		ub.updateColumnValue(GeometryIndex.COLUMN_MIN_Z,
				geometryIndex.getMinZ());
		ub.updateColumnValue(GeometryIndex.COLUMN_MAX_Z,
				geometryIndex.getMaxZ());
		ub.updateColumnValue(GeometryIndex.COLUMN_MIN_M,
				geometryIndex.getMinM());
		ub.updateColumnValue(GeometryIndex.COLUMN_MAX_M,
				geometryIndex.getMaxM());

		ub.where()
				.eq(GeometryIndex.COLUMN_TABLE_NAME,
						geometryIndex.getTableName()).and()
				.eq(GeometryIndex.COLUMN_GEOM_ID, geometryIndex.getGeomId());

		PreparedUpdate<GeometryIndex> update = ub.prepare();
		int updated = update(update);

		return updated;
	}
96329
function update( $data ) {

        // if this is an association result or it is limited,
        // create specific result for local rows and execute

        if ( $this->parent_ || isset( $this->limitCount ) ) {

            return $this->primaryResult()->update( $data );

        }

        return $this->db->update( $this->table, $data, $this->where, $this->whereParams );

    }
1203386
public function update(array $data) {
        // check if primary key is available
        $prim = $this->_model->info(Zend_Db_Table::PRIMARY);
        if (!is_array($prim)) {
            $prim = array($prim);
        }

        $where = array();
        foreach ($prim as $key) {
            if (!array_key_exists($key, $data)) {
                throw new Garp_Content_Exception('Primary key ' . $key . ' not available in data');
            }
            $where[] = $this->_model->getAdapter()->quoteInto($key . ' = ?', $data[$key]);
            unset($data[$key]);
        }
        $where = implode(' AND ', $where);

        try {
            /**
             * First, see if the user is allowed to update everything
             */
            $this->_checkAcl('update');
        } catch (Garp_Auth_Exception $e) {
            /**
             * If that fails, check if the user is allowed to update her own material
             * AND if the current item is hers.
             */
            $this->_checkAcl('update_own');

            /**
             * Good, the user is allowed to 'update_own'. In that case we have to check if
             * the current item is actually the user's.
             */
            if (!$this->_itemBelongsToUser($data, $where)) {
                throw new Garp_Auth_Exception('You are only allowed to edit your own material.');
            }
        }
        return $this->_model->update($data, $where);
    }
460921
public function updateOrInsert($data)
    {
        if ($this->first()) {
            return $this->update($data);
        } else {
            return $this->insert($data);
        }
    }
786559
public function updateGitRepository(array $data)
    {
        return $this->forge->updateSiteGitRepository($this->serverId, $this->id, $data);
    }
991974
public function update()
	{
		$db = \App::get('db');

		if (empty($db))
		{
			return false;
		}

		if (!is_numeric($this->gidNumber))
		{
			return false;
		}

		if (empty($this->_updatedkeys))
		{
			return true;
		}

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

		$classvars = get_class_vars(__CLASS__);

		$first = true;
		$affected = 0;

		foreach ($classvars as $property => $value)
		{
			if (($property{0} == '_') || in_array($property, self::$_list_keys))
			{
				continue;
			}

			if (!in_array($property, $this->_updatedkeys))
			{
				continue;
			}

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

			$value = $this->$property;

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

		$query .= " WHERE `gidNumber`=" . $db->quote($this->gidNumber) . ";";

		if (($first != true) && !empty($query))
		{
			$db->setQuery($query);

			$result = $db->query();

			if ($result === false)
			{
				return false;
			}

			$affected = $db->getAffectedRows();
		}

		$aNewUserGroupEnrollments = array();

		foreach (self::$_list_keys as $property)
		{
			if (!in_array($property, $this->_updatedkeys))
			{
				continue;
			}

			$aux_table = "#__xgroups_" . $property;

			$list = $this->$property;

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

			$ulist = null;
			$tlist = null;

			foreach ($list as $value)
			{
				if (!is_null($ulist))
				{
					$ulist .= ',';
					$tlist .= ',';
				}

				$ulist .= $db->quote($value);
				$tlist .= '(' . $db->quote($this->gidNumber) . ',' . $db->quote($value) . ')';
			}

			// @FIXME: I don't have a better solution yet. But the next refactoring of this class
			// should eliminate the ability to read the entire member table due to problems with
			// scale on a large (thousands of members) groups. The add function should track the members
			// being added to a group, but would need to be verified to handle adding members
			// already in group. *njk*

			// @FIXME: Not neat, but because all group membership is resaved every time even for single additions
			// there is no nice way to detect only *new* additions without this check. I don't want to
			// fire off an 'onUserGroupEnrollment' event for users unless they are really being enrolled. *drb*

			if (in_array($property, array('members', 'managers')))
			{
				$query = "SELECT uidNumber FROM `#__xgroups_members` WHERE gidNumber=" . $this->gidNumber;
				$db->setQuery($query);

				// compile current list of members in this group
				$aExistingUserMembership = array();

				if (($results = $db->loadAssoc()))
				{
					foreach ($results as $uid)
					{
						$aExistingUserMembership[] = $uid;
					}
				}

				// see who is new, merge with previous additions so we have a complete list after we are done
				$aNewUserGroupEnrollments = array_merge($aNewUserGroupEnrollments, array_diff($list, $aExistingUserMembership));

			}

			if (is_array($list) && count($list) > 0)
			{
				if (in_array($property, array('members', 'managers', 'applicants', 'invitees')))
				{
					$query = "REPLACE INTO $aux_table (gidNumber,uidNumber) VALUES $tlist;";
				}

				$db->setQuery($query);

				if ($db->query())
				{
					$affected += $db->getAffectedRows();
				}
			}

			if (!is_array($list) || count($list) == 0)
			{
				if (in_array($property, array('members', 'managers', 'applicants', 'invitees')))
				{
					$query = "DELETE FROM $aux_table WHERE gidNumber=" . $db->quote($this->gidNumber) . ";";
				}
			}
			else
			{
				if (in_array($property, array('members', 'managers', 'applicants', 'invitees')))
				{
					$query = "DELETE m FROM `#__xgroups_$property` AS m WHERE " . " m.gidNumber=" .
						$db->quote($this->gidNumber) . " AND m.uidNumber NOT IN (" . $ulist . ");";
				}
			}

			$db->setQuery($query);

			if ($db->query())
			{
				$affected += $db->getAffectedRows();
			}
		}

		// After SQL is done and has no errors, fire off onGroupUserEnrolledEvents
		// for every user added to this group
		foreach ($aNewUserGroupEnrollments as $userid)
		{
			\Event::trigger('groups.onGroupUserEnrollment', array($this->gidNumber, $userid));
		}

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

		return true;
	}
193365
public function update( array $args ) {

		/** @var array $EZSQL_ERROR */
		global $EZSQL_ERROR;
		if ( empty( $EZSQL_ERROR ) ) {
			return new NullLog();
		}

		$errors  = $EZSQL_ERROR;
		$last    = end( $errors );
		$context = [ 'last_query' => $last[ 'query' ], 'errors' => $errors, ];

		return new Error( $last[ 'error_str' ], Channels::DB, $context );
	}
627843
public static function getGeoDBO()
	{
		static $instance;

		if (!is_object($instance))
		{
			$geodb_params = \Component::params('com_system');

			$options = array();
			$options['driver']   = $geodb_params->get('geodb_driver', 'pdo');
			$options['host']     = $geodb_params->get('geodb_host', 'localhost');
			$options['port']     = $geodb_params->get('geodb_port', '');
			$options['user']     = $geodb_params->get('geodb_user', '');
			$options['password'] = $geodb_params->get('geodb_password', '');
			$options['database'] = $geodb_params->get('geodb_database', '');
			$options['prefix']   = $geodb_params->get('geodb_prefix', '');

			if (empty($options['database']) || empty($options['user']) || empty($options['password']))
			{
				return null;
			}

			try
			{
				$instance = \Hubzero\Database\Driver::getInstance($options);
			}
			catch (\Exception $e)
			{
				$instance = false;
			}
		}

		if (!$instance || ($instance instanceof Exception) || !$instance->getConnection())
		{
			return null;
		}

		return $instance;
	}
646305
public function setStatus() {
        $controller = new JsonController();
        
        $ga_id = Filter::getInteger('ga_id');
        $ga = $this->provider->getGeoAnalysis($ga_id, false);
        
        $controller->restrictAccess(
            true // Filter::checkCsrf()   -- Cannot use CSRF on a GET request (modules can only work with GET requests)
            &&  Auth::isManager(Globals::getTree()) 
            && $ga !== null
        );
        
        $status = Filter::getBool('status');
        $res = array('geoanalysis' => $ga->getId() , 'error' => null);
        try{
            $this->provider->setGeoAnalysisStatus($ga, $status);
            $res['status'] = $status;
			Log::addConfigurationLog('Module '.$this->module->getName().' : Geo Analysis ID "'.$ga->getId().'" has been '. ($status ? 'enabled' : 'disabled') .'.');
        }
        catch (\Exception $ex) {
            $res['error'] = $ex->getMessage();
			Log::addErrorLog('Module '.$this->module->getName().' : Geo Analysis ID "'.$ga->getId().'" could not be ' . ($status ? 'enabled' : 'disabled') .'. Error: '. $ex->getMessage());
        }
        
        $controller->pageHeader();
        if($res['error']) http_response_code(500);
        
        $controller->encode($res);
    }
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();
    }
1229916
public function ga( )
    {
        // Grab the params
        $params = func_get_args();
        
        // If we have a create call, make sure we initialize a new tracker
        if($params[0] == 'create')
        {
            return call_user_func_array(array($this, 'create'), array_slice($params, 1));
        }
        
        foreach($this->instances as $instance)
        {
            // Call each instance->ga()
            call_user_func_array(array($instance, 'ga'), $params);
        }
    }
791407
public function UpdateGroup(\Google\Cloud\Monitoring\V3\UpdateGroupRequest $argument,
      $metadata = [], $options = []) {
        return $this->_simpleRequest('/google.monitoring.v3.GroupService/UpdateGroup',
        $argument,
        ['\Google\Cloud\Monitoring\V3\Group', 'decode'],
        $metadata, $options);
    }
67720
protected function getAggregatedDataTableMap($data, $columnsAggregationOperation)
    {
        $table = new DataTable();

        if (!empty($columnsAggregationOperation)) {
            $table->setMetadata(DataTable::COLUMN_AGGREGATION_OPS_METADATA_NAME, $columnsAggregationOperation);
        }

        if ($data instanceof DataTable\Map) {
            // as $date => $tableToSum
            $this->aggregatedDataTableMapsAsOne($data, $table);
        } else {
            $table->addDataTable($data);
        }

        return $table;
    }