Update the model pictures.

@param  array $pictures

@return array
483894
public function updatePictures($pictures)
    {
        foreach ($pictures as $picture) {
            $image = $this->pictures()->where('id', $picture['id']);

            if ($image->exists()){
               $image->update(['path' => $picture['path']]);
            } else {
               $this->pictures()->create(['path' => $picture['path']]);
            }
        }
    }
799659
public function update($attributes)
    {
        if (!empty($attributes)) {
            foreach ($attributes as $attribute => $value) {
                $this->set($attribute, $value);
            }
        }

        return $this;
    }
177783
public function update(array $attributes, $idOrModel, array $options = [])
    {
    	$product = $this->modelOrFind($idOrModel);
    	$attributes = Collection::make($attributes);

    	$attr = $attributes->except('features', 'pictures', 'default_picture')->merge([
            'features' => \Antvel\Features\Parser::toJson($attributes->get('features')),
            'category_id' => $attributes->get('category'),
            'price' => $attributes->get('price') * 100,
            'cost' => $attributes->get('cost') * 100,
            'status' => $attributes->get('status'),
            'updated_by' => auth()->user()->id,
            'tags' => $attributes->get('name'),
        ])->all();

    	$this->updatePicturesFor($product, $attributes);

    	return $product->update($attr);
    }
949021
public function addPicture(\Dacorp\ExtraBundle\Entity\DacorpMedia $pictures)
    {
        $this->pictures[] = $pictures;
    
        return $this;
    }
273015
public function update(array $values): array
	{
		$sql  = $this->query->getPrefix();
		$sql .= 'UPDATE ';
		$sql .= $this->escapeTable($this->query->getTable());
		$sql .= ' SET ';
		$sql .= $this->updateColumns($values);
		$sql .= $this->wheres($this->query->getWheres());

		return ['sql' => $sql, 'params' => $this->params];
	}
538999
final public function update(array $keys = null)
    {
        $pre = $this->preUpdate($keys);
        if ($pre === false) {
            $this->logger->error(sprintf(
                'Can not update object "%s:%s"; cancelled by %s::preUpdate()',
                $this->objType(),
                $this->id(),
                get_called_class()
            ));
            return false;
        }

        $ret = $this->source()->updateItem($this, $keys);
        if ($ret === false) {
            $this->logger->error(sprintf(
                'Can not update object "%s:%s"; repository failed for %s',
                $this->objType(),
                $this->id(),
                get_called_class()
            ));
            return false;
        }

        $post = $this->postUpdate($keys);
        if ($post === false) {
            $this->logger->warning(sprintf(
                'Updated object "%s:%s" but %s::postUpdate() failed',
                $this->objType(),
                $this->id(),
                get_called_class()
            ));
            return false;
        }

        return true;
    }
455210
public function saveMany($models)
    {
        // Convert to collection if array
        $models = is_array($models) ? collection($models) : $models;

        foreach ($models as &$model) {
            $model = $this->save($model);
        }

        return $models;
    }
1066799
public function setModels($models)
    {
        if (!is_object($models)) {
            if (is_array($models)) {
                $models = collect($models);
            }
        }

        if(class_basename($models->first()) == 'stdClass')
        {
            $models = $models->map(function ($array) {
                return new BlankModel($array);
            });
        }

        $this->models = $models;
    }
358136
public function update(array $data, array $files = [])
    {
        if ($data) {
            $blueprint = $this->getBlueprint();

            // Process updated data through the object filters.
            $this->filterElements($data);

            // Get currently stored data.
            $elements = $this->getElements();

            // Merge existing object to the test data to be validated.
            $test = $blueprint->mergeData($elements, $data);

            // Validate and filter elements and throw an error if any issues were found.
            $blueprint->validate($test + ['storage_key' => $this->getStorageKey(), 'timestamp' => $this->getTimestamp()]);
            $data = $blueprint->filter($data, false, true);

            // Finally update the object.
            foreach ($blueprint->flattenData($data) as $key => $value) {
                if ($value === null) {
                    $this->unsetNestedProperty($key);
                } else {
                    $this->setNestedProperty($key, $value);
                }
            }

            // Store the changes
            $this->_changes = Utils::arrayDiffMultidimensional($this->getElements(), $elements);
        }

        if ($files && method_exists($this, 'setUpdatedMedia')) {
            $this->setUpdatedMedia($files);
        }

        return $this;
    }
75435
protected function addUpdatedAtColumn(array $values)
    {
        if (! $this->model->usesTimestamps()) {
            return $values;
        }
        $column = $this->model->getUpdatedAtColumn();
        if (null === array_get($values, $column)) {
            array_set($values, $column, $this->model->freshTimestampString());
        }
        return $values;
    }
319673
protected static function buildMorphMapFromModels(array $models = null)
    {
        if (is_null($models) || array_is_assoc($models)) {
            return $models;
        }

        $tables = array_map(function ($model) {
            return (new $model)->getTable();
        }, $models);

        return array_combine($tables, $models);
    }
1210504
public function updateClassNames(&$classes)
    {
        // Update Class Names (via parent):
        
        parent::updateClassNames($classes);
        
        // Update Class Names:
        
        if ($this->owner->isEdgeToEdge()) {
            $classes[] = $this->style('column.edge-to-edge');
        }
    }
533492
static public function updateOrCreateRecords(array $records) {
        $table = static::getInstance();
        $alreadyInTransaction = $table::inTransaction();
        if (!$alreadyInTransaction) {
            $table::beginTransaction();
        }
        try {
            foreach ($records as $record) {
                $success = $table::updateOrCreateRecord($record);
                if (!$success) {
                    if (!$alreadyInTransaction) {
                        $table::rollBackTransaction();
                    }
                    return false;
                }
            }
            if (!$alreadyInTransaction) {
                $table::commitTransaction();
            }
            return true;
        } catch (\Exception $exc) {
            if (!$alreadyInTransaction && $table::inTransaction()) {
                $table::rollBackTransaction();
            }
            /** @noinspection ExceptionsAnnotatingAndHandlingInspection */
            throw $exc;
        }
    }
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;
    }
1013608
public function update($attributes)
    {
        $this->attributes = array_merge($this->attributes, array_filter($attributes, function ($attribute) {
            return ! is_null($attribute);
        }));

        return $this;
    }
781140
public function update(array $attributes)
    {
        if ($this->related->usesTimestamps()) {
            $attributes[$this->relatedUpdatedAt()] = $this->related->freshTimestamp();
        }

        return $this->query->update($attributes);
    }
1078884
public function setMinified(array $files)
    {
        if (!empty($files)) {
            foreach ($files as $_file) {
                $this->addMinified($_file);
            }
        }
        return $this;
    }