Sync the updated records.

@param  array  $updated
769238
private function syncUpdated(array $updated)
    {
        foreach ($updated as $key => $value) {
            $this->newQuery()
                 ->where($this->keyColumn, '=', $key)
                 ->update([$this->valueColumn => $value]);
        }
    }
396024
function() {
    var self = this
    self._shouldSyncFromOpts = true
    self.on('update', function() {
      if (self._shouldSyncFromOpts) self.trigger('sync')
      self._shouldSyncFromOpts = true
    })
  }
1333181
public function setStyle(array $style = [], $update = true)
    {
        $this->style = $update
            ? array_merge($this->style, $style)
            : $style;

        return $this;
    }
744726
public function sync($attributes)
    {
        if (isset($attributes['$id'])) {
            $this->state = static::STATE_ATTACHED;
            $this->id = $attributes['$id'];
        } else {
            foreach ($this->schema() as $key => $field) {
                if ($field->has('default')) {
                    $attributes[$key] = $field['default'];
                }
            }

            $this->state = static::STATE_DETACHED;
        }

        $this->set($attributes);
        $this->populateOld();
    }
229950
private function updateComponentVersions(array $release)
    {
        foreach ($release as $key => $releaseComponent)
        {
            $component = $this->getComponentComposer($this->rootPath(), $key);

            $this->addToComponentManifest($releaseComponent['version'], $component);
            foreach ((array) $component['entry'] as $entry) {
                $entryUpdated = $this->updateComponentVersionConstant(
                    $releaseComponent['version'],
                    $component['path'],
                    $entry
                );
            }

            if ($component['id'] !== 'google-cloud') {
                $this->updateComponentVersionFile($releaseComponent['version'], $component);
                $this->updateComposerReplacesVersion($releaseComponent['version'], $component);
            }
        }
    }
1138076
public function commit()
    {
        list($old, $new) = $this->generateRollback();
        $updates = $this->generateUpdates();
        $updates = $this->combineUpdates($updates);
        usort($updates, array($this, 'sortUpdates'));

        foreach ($updates as $update) {
            // apply update to cache & receive a simple bool to indicate
            // success (true) or failure (false)
            $success = call_user_func_array($update[1], $update[2]);
            if ($success === false) {
                $this->rollback($old, $new);

                return false;
            }
        }

        $this->clear();

        return true;
    }
1024858
static function sync($obj)
    {
        if (self::exists($obj)) {

            self::drop($obj);
            self::alter($obj);

        } else {
            self::create($obj);
        }
    }
752920
public function updateMany(array $sets)
    {
        $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id';

        if (method_exists($this, 'updateRecordSets')) {
            foreach ($sets as $key => $set) {
                $this->updateRecordSets($sets[ $key ]);
            }
        }

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

        if ($this->qb->table($this->table)->updateBatch($sets, $primaryKey)) {
            if (method_exists($this, 'afterUpdateMany')) {
                return $this->afterUpdateMany();
            }

            return $this->db->getAffectedRows();
        }

        return false;
    }
703061
function sync() {
    syncDom.setAttribute('data-sync-state', 'syncing');
    var opts = {continuous: true, complete: syncError};
    db.replicate.to(remoteCouch, opts);
    db.replicate.from(remoteCouch, opts);
  }
1237570
public function update(array $values)
    {
        if (!$this->hasId()) {
            throw new UpdateException('ID not set - did you call find($id) before update($values)?');
        }

        if (!$this->isUpdatable()) {
            throw new UpdateException('Permission denied: Entity can not be updated');
        }

        $this->transactional(function () use ($values) {
            $this->forceUpdate($values);
        });

        return $this;
    }
938651
private function doUpdate(array $changes) {
        $db     = $this->db();
        $entity = $this->dao()->getEntityMapping();
        $table  = $entity->getTableName();

        // collect identity infos
        $identity = $entity->getIdentity();
        $idColumn = $identity->getColumn();
        $idValue  = $identity->convertToDBValue($this->getObjectId(), $db);

        // collect version infos
        $versionMapping = $versionName = $versionColumn = $oldVersion = null;
        //if ($versionMapping = $entity->getVersion()) {
        //    $versionName   = $versionMapping->getName();
        //    $versionColumn = $versionMapping->getColumn();
        //    $oldVersion    = $object->getSnapshot()->$versionName;        // TODO: implement dirty check via snapshot
        //    $oldVersion    = $versionMapping->convertToDBValue($oldVersion, $db);
        //}

        // create SQL
        $sql = 'update '.$table.' set';                                     // update table
        foreach ($changes as $name => $value) {                             //    set ...
            $mapping     = $entity->getProperty($name);                     //        ...
            $columnName  = $mapping->getColumn();                           //        ...
            $columnValue = $mapping->convertToDBValue($value, $db);         //        column1 = value1,
            $sql .= ' '.$columnName.' = '.$columnValue.',';                 //        column2 = value2,
        }                                                                   //        ...
        $sql  = strLeft($sql, -1);                                          //        ...
        $sql .= ' where '.$idColumn.' = '.$idValue;                         //    where id = value
        if ($versionMapping) {                                              //        ...
            $op   = $oldVersion=='null' ? 'is':'=';                         //        ...
            $sql .= ' and '.$versionColumn.' '.$op.' '.$oldVersion;         //      and version = oldVersion
        }

        // execute SQL and check for concurrent modifications
        if ($db->execute($sql)->lastAffectedRows() != 1) {
            if ($versionMapping) {
                $this->reload();
                $msg = 'expected version: '.$oldVersion.', found version: '.$this->$versionName;
            }
            else $msg = 'record not found';
            throw new ConcurrentModificationException('Error updating '.get_class($this).' (oid='.$this->getObjectId().'), '.$msg);
        }
        return true;
    }
453976
public function updateMany(array $settings)
    {
        // TODO Use DB::beginTransaction(), DB::rollback(), DB::commit() ?
        foreach ($settings as $k => $v) {
            if ($this->update($k, $v) === false) {
                return false;
            }
        }

        return true;
    }
983191
public function update(array $fields = [])
    {
        $connection = $this->getConnection();

        $this->beforeUpdateInternal();

        $connection->beginTransaction();
        try {
            if ($updated = $this->updateInternal($fields)) {
                $connection->commit();
            } else {
                $connection->rollBack();
            }
        } catch (Exception $e) {
            $connection->rollBack();
            throw $e;
        }

        $this->afterUpdateInternal();

        if ($updated) {
            $this->updateRelated();
            $this->attributes->resetOldAttributes();
        }

        return $updated;
    }
177598
public function executeUpdates($updates) {
    /** @var Updates $updates_object */
    $updates_object = new $this->updateClassName($this);
    $this->output->writeln("Executing updates...");

    /**
     * @var string $method_name
     * @var Update $update
     */
    foreach ($updates as $method_name => $update) {
      $this->output->writeln("-> $method_name: {$update->description}");
      call_user_func([$updates_object, $method_name]);
    }
  }
1311376
public function syncMeta($array)
    {
        $meta = [];

        foreach ($array as $key => $value) {
            $meta[$key] = $this->makeMeta($key, $value);
        }

        $this->meta()->delete();
        $this->meta()->saveMany($meta);

        // Update cached relationship.
        $collection = $this->makeMeta()->newCollection($meta);
        $this->setRelation('meta', $collection);
    }
1213669
private function sortThemeLayoutUpdates(array $updates)
    {
        $directories = [];
        $files = [];
        foreach ($updates as $key => $update) {
            if (is_array($update)) {
                $update = $this->sortThemeLayoutUpdates($update);
                $directories[$key] = $update;
            } else {
                $files[] = $update;
            }
        }

        sort($files);
        ksort($directories);
        $updates = array_merge($files, $directories);

        return $updates;
    }
1291805
protected function processUpdate(Update $update): void
	{
		// Register all commands
		$this->registerHandlers();
		$this->registerHelpCommand();

		// messages
		if ($update->getMessage() !== null) {

			$message = $update->getMessage();

			// Banned users
			$senderId = $message->getFrom()->getId();
			if ($this->userIsBanned($senderId)) {
				$this->replyBannedUser($message->getChat()->getId(), $senderId);
				goto postProcessing;
			}

			// Check for conversations
			if ($message->getReplyToMessage() !== null) {
				$repliedMessage = $message->getReplyToMessage();
				$repliedMessageId = $repliedMessage->getMessageId();
				$chatId = $message->getChat()->getId();
				$userId = $message->getFrom()->getId();
				$botName = $this->username;
				$fileName = $this->storageLocation . "/{$botName}_{$chatId}_{$userId}_{$repliedMessageId}";

				if (file_exists($fileName)) {
					\KeythKatz\TelegramBotCore\Conversation::resumeConversation($fileName, $message, $this);
					goto postProcessing;
				}
			}

			// Parse for valid targeted command
			$processed = false;
			$rawMessage = $message->getText();
			if ($rawMessage !== null && substr($rawMessage, 0, 1) === '/') {

				list($command, $arguments) = $this->splitMessage($rawMessage);

				// Call handler
				if (isset($this->commands[$command])) {
					$handler = $this->commands[$command];
					$handler->setMessage($message);
					$handler->process($arguments, $message);
					$processed = true;
				}
			}
			
			// Raw Message
			if (!$processed) {
				$this->genericMessageHandler->setMessage($message);
				$this->genericMessageHandler->process($message);
			}
		// Callback queries
		} else if ($update->getCallbackQuery() !== null) {
			$query = $update->getCallbackQuery();

			// Check for InteractiveMessage
			$message = $query->getMessage();
			if ($message != null) {
				$botName = $this->username;
				$chatId = $message->getChat()->getId();
				$messageId = $message->getMessageId();
				$fileName = $this->storageLocation . "/{$botName}_{$chatId}_interactive_{$messageId}";
				if (file_exists($fileName)) {
					\KeythKatz\TelegramBotCore\InteractiveMessage::handleCallbackQuery($fileName, $query, $this);
				}
			// Default callback query
			} else if ($this->cqHandler !== null) {

				$senderId = $query->getFrom()->getId();
				if ($this->userIsBanned($senderId)) {
					$this->replyBannedUser($query->getMessage()->getChat()->getId(), $senderId);
					goto postProcessing;
				}

				$message = $query->getMessage();
				if ($message !== null) {
					$this->cqHandler->setMessage($message);
				}

				$this->cqHandler->setQuery($query);
				$this->cqHandler->process($query, $message);
			}
		}

postProcessing:
		$this->finishPromises();
		echo "Everything will be okay";
	}