Update the given model in the index.

@param  Collection  $models
@return void
514393
public function update($models)
    {
        $params['body'] = [];

        $models->each(function($model) use (&$params)
        {
            $params['body'][] = [
                'update' => [
                    '_id' => $model->getKey(),
                    '_index' => $this->index,
                    '_type' => $model->searchableAs(),
                ]
            ];
            $params['body'][] = [
                'doc' => $model->toSearchableArray(),
                'doc_as_upsert' => true
            ];
        });

        $this->elastic->bulk($params);
    }
362218
public function addEagerConstraints(array $models)
    {
        $whereIn = $this->whereInMethod($this->parent, $this->localKey);

        $this->query->{$whereIn}(
            $this->foreignKey, $this->getKeys($models, $this->localKey)
        );
    }
1301167
public function setLists($lists)
  {
    $this->lists=$lists;
    // update the storage, else we are out of sync
    $this->storage->updateLists($this->lists);
  }
309359
protected function processSort(array $models = [])
    {
        $field = $this->builder->getSortByField();

        $flags = $this->builder->getSortByFlags();

        $direction = $this->builder->getSortByDirection();

        $desc = ($direction === 'desc' ? true : false);

        return $this->newCollection($models)->sortBy($field, $flags, $desc);
    }
1339820
function updateNestedModels() {
  nestedRegistry.models = [];
  _.each(nestedRegistry.views, function(view) {
    var data = (view.obj.model || view.obj.collection);
    if (data) {
      nestedRegistry.models.push(flatRegistry.models[data.getDebugName()]);
    }
  });
}
1018478
protected function prepare($models)
    {
        return !is_null($models) ?
        ((Collection::count($models) > 0)
            ? ((Collection::count($models) == 1)
                ? $models[0]
                : $models
            )
            : null
        )
        : null;
    }
51793
public function addEagerConstraints(array $models)
    {
        $this->query->whereIn($this->getForeignKey(), $this->getKeys($models));
    }
840178
public function update(array $values)
    {
        $count = 0;

        foreach ($this->getModels() as $model) {
            $model->fill($values);
            $count += $model->save() ? 1 : 0;
        }

        return 0;
    }
615496
function setModels($models, $init=true) {
		array_map(array($this,'add'),$models);
		if ($init)
			$this->changed = false;
	}
391896
public function updateModels(Models $models)
    {
        foreach ($models as $model) {
            if ($model->isSoftDeleted()) {
                $this->dispatchBeforeEvent($model, Event::DELETE);
            } else {
                $this->dispatchBeforeEvent($model, Event::UPDATE);
                $this->dispatchBeforeEvent($model, Event::SAVE);
            }
        }

        $this->updateAll()->executeModels($models);

        foreach ($models as $model) {

            $model->resetOriginals();

            if ($model->isSoftDeleted()) {
                $this->dispatchAfterEvent($model, Event::DELETE);
            } else {
                $this->dispatchAfterEvent($model, Event::UPDATE);
                $this->dispatchAfterEvent($model, Event::SAVE);
            }
        }

        return $this;
    }
576556
public function addEagerConstraints(array $models)
    {
        $keys = $this->getKeys($models, $this->getFirstForeignKeyName());

        $this->query->whereIn($this->getQualifiedFirstLocalKeyName(), $keys);
    }
368993
public function setClasses($classes)
    {
        if (!is_array($classes)) {
            $classes = $classes ? array($classes) : array();
        }
        $this->modelClasses = $classes;
    }
941053
protected function processSomeAttachments(Collection $models, array $attachments)
    {
        $progress = $this->getProgressBar($models);
        $progress->start();

        foreach ($models as $model) {
            $progress->advance();

            foreach ($model->getAttachedFiles() as $attachedFile) {
                if (in_array($attachedFile->name, $attachments)) {
                    $attachedFile->reprocess();
                }
            }
        }

        $progress->finish();
    }
726980
public function saveMany($models) {
        // We will collect the edges returned by save() in an Eloquent Database Collection
        // and return them when done.
        $edges = new Collection;

        foreach ($models as $model) {
            $edges->push($this->save($model, $properties));
        }

        return $edges;
    }
556735
public function setModel(Model $model)
    {
        parent::setModel($model);

        if ($model->exists) {
            $this->setInstance($model);
            $this->loadRelationValues();
        }
    }
302887
public function setModels(array $models): ModelCollectionInterface
    {
        foreach ($this->models as $model) {
            $this->removeModel($model);
        }
        foreach ($models as $model) {
            $this->addModel($model);
        }

        return $this;
    }
833499
public function collections(array $collections) : void {
        foreach ($collections as $name => $callback) {
            $this->make($name, $callback);
        }
    }