Updates the session

@param   boolean  $updateNulls  True to update fields even if they are null.

@return  boolean  True on success.

@since   11.1
@deprecated  13.3  Use SQL queries to interact with the session table.
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;
		}
	}
693053
public function update( array $args ) {

		if ( self::$ran ) {
			return new NullLog();
		}

		if ( $this->is_cron() || $this->is_cli() ) {
			$this->register_event_listener();
		}

		return new NullLog();
	}
917795
public function update()
    {
        $conditions = $this->infosMergeds['fields_and_values'];

        $this->sql = new PhiberQueryWriter("update", [
            "table"  => $this->table,
            "fields" => $this->fields,
            "values" => $this->fieldsValues,
            "where"  => isset($this->infosMergeds['where']) ?
                $this->infosMergeds['where'] :
                null,
            "limit"  => isset($this->infosMergeds['limit']) ?
                $this->infosMergeds['limit'] :
                null,
            "offset"  => isset($this->infosMergeds['offset']) ?
                $this->infosMergeds['offset'] :
                null
        ]);

        if ($this->phiberConfig->verifyExecuteQueries()) {

            $this->PDO = $this->PDO->prepare($this->sql);
            for ($i = 0; $i < count($this->fields); $i++) {
                if (!empty($this->fieldsValues[$i])) {
                    $this->PDO->bindValue($this->fields[$i], $this->fieldsValues[$i]);
                }
            }

            while (current($conditions)) {
                $this->PDO->bindValue(
                    "condition_" . key($conditions), 
                    $conditions[key($conditions)]
                );
                
                next($conditions);
            }

            if ($this->PDO->execute()) {
                return true;
            }
        }

        return false;
    }
435987
protected function store($updateNulls=false)
  {
    $row = TableRow::create();
    
    foreach($this->getFields() as $fieldName => $fieldInfos){
      $fieldValue = $this->row->get($fieldName);
      
      switch($fieldInfos->Type){
        case 'bigint':
        case 'mediumint':
        case 'smallint':
        case 'tinyint':
          $fieldValue = (int)$fieldValue;
          break;
        
        case 'datetime':
        case 'timestamp':
          if ( !$fieldValue ){
            $fieldValue = $this->db->getNullDate(true);
          }
          break;
        
        case 'date':
          if ( !$fieldValue ){
            $fieldValue = $this->db->getNullDate(false);
          }
          break;
        
        case 'time':
          if ( !$fieldValue ){
            $fieldValue = '00:00:00';
          }
          break;
      }
      
      $row->set($fieldName, $fieldValue);
    }
    
    if ( $row->get($this->tbl_key) ){
      $ret = $this->db->updateObject($this->tbl, $row, $this->tbl_key, $updateNulls);
    }
    else {
      $ret = $this->db->insertObject($this->tbl, $row, $this->tbl_key);
      $this->row->set($this->tbl_key, (int)$row->get($this->tbl_key));      
    }
    
    if ( $ret ){
      if ( $this->orderingAble() ){
        $this->reorder( $this->getReorderConditions() );
      }
      return true;
    }
    
    return false;
  }
16836
public function isUpdate($update = true, $where = null)
    {
        if (is_bool($update)) {
            $this->exists = $update;

            if (!empty($where)) {
                $this->updateWhere = $where;
            }
        } else {
            $this->exists      = true;
            $this->updateWhere = $update;
        }

        return $this;
    }
1300841
final public function updateNotNull() {
	
		$class		= get_called_class();
		$binds		= $class::getBinds();
		$properties	= array();
		
		foreach ($binds as $objProp => $dbField) {
				
			if (!is_null($this->$objProp))  {
				$properties[] = $objProp;
			}
				
		}
		
		$ret = $this->update($properties);
		
		return $ret;

	}
426397
public function regenerate( $updateBackendData = true )
    {
        $oldSessionId = session_id();
        session_regenerate_id();
        $newSessionId = session_id();

        ezpEvent::getInstance()->notify( 'session/regenerate', array( $oldSessionId, $newSessionId ) );

        if ( $updateBackendData )
        {
            $db = eZDB::instance();
            if ( !$db->isConnected() )
            {
                return false;
            }

            $escOldKey = $db->escapeString( $oldSessionId );
            $escNewKey = $db->escapeString( $newSessionId );
            $escUserID = $db->escapeString( eZSession::userID() );
            eZSession::triggerCallback( 'regenerate_pre', array( $db, $escNewKey, $escOldKey, $escUserID ) );

            $db->query( "UPDATE ezsession SET session_key='$escNewKey', user_id='$escUserID' WHERE session_key='$escOldKey'" );
            $db->query( "UPDATE ezbasket SET session_id='$escNewKey' WHERE session_id='$escOldKey'" );

            eZSession::triggerCallback( 'regenerate_post', array( $db, $escNewKey, $escOldKey, $escUserID ) );
        }
        return true;
    }
287697
public function update() {
        $this->isNewRecord = false;
        if ($this->usesTimestamps()) {
            $this->updateTimestamps();
        }
        $this->invoke(self::BEFORE_UPDATE, [$this]);
        if (!$this->validate()) {
            return false;
        }
        $query = $this->getPrimaryKeyQuery();
        if (empty($query)) {
            $this->setError('pk', 'ERROR PK!');
            return false;
        }
        $data = $this->_getRealFields();
        if (empty($data)) {
            return true;
        }
        $row = $query
            ->update($data);
        if (!empty($row)) {
            $this->setOldAttribute();
        } else {
            $this->setError('data', 'Data is not change!');
        }
        $this->invoke(self::AFTER_UPDATE, [$this]);
        return $row;
    }
564472
public function upsert($table, $insertFieldValues, $updateFieldValues = [], $primaryKey = null)
    {
        if (!$primaryKey) {
            $primaryKey = (string)key($insertFieldValues);
        }

        if ($this->query($table)->whereEq($primaryKey, $insertFieldValues[$primaryKey])->exists()) {
            $bind = [];
            $updates = [];
            foreach ($updateFieldValues as $k => $v) {
                $field = is_string($k) ? $k : $v;
                if ($primaryKey === $field) {
                    continue;
                }

                if (is_int($k)) {
                    $updates[] = "[$field]=:$field";
                    $bind[$field] = $insertFieldValues[$field];
                } elseif ($v instanceof AssignmentInterface) {
                    $v->setFieldName($k);
                    $updates[] = $v->getSql();
                    /** @noinspection SlowArrayOperationsInLoopInspection */
                    $bind = array_merge($bind, $v->getBind());
                } else {
                    $updates[] = $v;
                }
            }
            return $this->update($table, $updates, [$primaryKey => $insertFieldValues[$primaryKey]], $bind);
        } else {
            return $this->insert($table, $insertFieldValues);
        }
    }
67436
public function update($subscriptions)
    {
        $this->initCollection();

        /** @var SubscriptionInterface $subscription */
        foreach ($subscriptions as $subscription) {
            $this->changeSubscription(
                $subscription,
                (bool)$subscription->getSubscriberStatus() === true ?
                    Subscriber::STATUS_SUBSCRIBED :
                    Subscriber::STATUS_UNSUBSCRIBED
            );
        }

        return $this->statusResponseFactory->create()
            ->setStatus('ok');
    }
800696
private function update($columns, $values)
    {
        $query = Query::table(static::$table);
        //
        for ($i = 0; $i < Table::count($columns); $i++) {
            $query = !empty($values[$i]) ? $query->set($columns[$i], $values[$i]) : $query->set($columns[$i], 'null', false);
        }
        //
        $query->where($this->_keyName, '=', $this->_keyValue)
        ->update();
        //
        return $query;
    }
1324618
protected function updateInternal(array $fields = [])
    {
        $values = $this->getChangedAttributes($fields);
        if (empty($values)) {
            return true;
        }

        $rows = $this->objects()
            ->filter($this->getPrimaryKeyValues())
            ->update($values);

        foreach ($values as $name => $value) {
            $this->setAttribute($name, $value);
        }
        $this->updateRelated();

        return $rows >= 0;
    }
564107
public function update($params)
    {
        if (is_array($params)) {
            $count_rows = count($params['columns']);
            $increment = 1;
            foreach ($params['columns'] as $keys => $value) {
                for ($i = 1; $i <= $count_rows; $i++) {
                    $data[$keys] = $value;
                }
            }
            foreach ($data as $keys => $values) {
                if ($increment == $count_rows) {
                    $columns[] = "{$keys} = '{$values}'";
                } else {
                    $columns[] = "{$keys} = '{$values}'";
                }
                $increment++;
            }
            $columns = implode(' , ', $columns);
            $wheres = $this->prepareWhere($params['wheres']);
            $query = "UPDATE `{$params['table']}`SET {$columns} {$wheres}";
            if (isset($params['debug']) and strtolower($params['debug']) === 'on') {
                var_dump($query);
            }

            return $query;
        } else {
            return false;
        }
    }
603683
public function update($fields)
    {
        // Set fields
        $this->fields($fields);

        // Resolve fields
        $fields = $this->getUpdateFieldsString();

        // Define wheres
        $where = $this->getWhereString();

        // Build query
        $this->query = 'UPDATE ' . $this->table . ' SET ' . $fields . ' '. $where;

        // Prepare statement
        $this->statement = $this->pdo->prepare($this->query);

        // Bind fields values
        $this->bindFields();

        // Bind where values
        if (count($this->wheres)) {
            $this->bindWheres();
        }

        // Execute statement
        $result = $this->statement->execute();

        // Reset values
        $this->reset();

        // Return result
        return $result;
    }
824051
public function update(array $sets, $conditions = [])
    {
        if (count($sets)) {
            $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id';

            if (empty($conditions)) {
                if (isset($sets[ $primaryKey ])) {
                    $conditions = [$primaryKey => $sets[ $primaryKey ]];
                }
            }

            if (method_exists($this, 'updateRecordSets')) {
                $this->updateRecordSets($sets);
            }

            if (method_exists($this, 'beforeUpdate')) {
                $sets = $this->beforeUpdate($sets);
            }

            if (method_exists($this, 'getRecordOrdering')) {
                if ($this->recordOrdering === true && empty($sets[ 'record_ordering' ])) {
                    $sets[ 'record_ordering' ] = $this->getRecordOrdering($this->table);
                }
            }

            if ($this->qb->table($this->table)->update($sets, $conditions)) {

                if (method_exists($this, 'afterUpdate')) {
                    return $this->afterUpdate();
                }

                return true;
            }
        }

        return false;
    }
1026634
protected function updateRecordSets(array &$sets)
    {
        if(is_null($this->recordUser)) {
            if(globals()->offsetExists('account')) {
                $this->setRecordUser(globals()->account->id);
            }
        }

        if ( ! isset($sets[ 'record_status' ])) {
            $sets[ 'record_status' ] = $this->recordStatus;
        }

        if ( ! isset($sets[ 'record_update_user' ])) {
            $sets[ 'record_update_user' ] = $this->recordUser;
        }

        $timestamp = $this->unixTimestamp === true ? strtotime(date('Y-m-d H:i:s')) : date('Y-m-d H:i:s');

        if ( ! isset($sets[ 'record_update_timestamp' ])) {
            $sets[ 'record_update_timestamp' ] = $timestamp;
        }
    }
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;
	}