Devise\Pages\Interpreter\TagManager::updateInstance PHP Метод

updateInstance() защищенный Метод

Updates an instance with the fields given but only if the field values are different than what is already in the database
protected updateInstance ( Eloquent $instance, array $fields ) : void
$instance Eloquent
$fields array
Результат void
    protected function updateInstance($instance, $fields)
    {
        $changed = false;
        foreach ($fields as $field => $value) {
            if ($instance->{$field} != $value) {
                $changed = true;
                $instance->{$field} = $value;
            }
        }
        if ($changed) {
            $instance->save();
        }
        return $instance;
    }