Saves the domain object via the associated mapper
@chainable
961749
public function save()
    {
        $event = $this->isSaved() ? 'Update' : 'Create';
        $mapper = Pheasant::instance()->mapperFor($this);

        $this->events()->wrap(array($event, 'Save'), $this, function($obj) use ($mapper) {
            $mapper->save($obj);

            // ensure we clear the changes before after events fire
            $obj->markSaved(true)->clearChanges();
        });

        return $this;
    }
1222246
public function save(){
    $table  = static::persistenceOptions('table');
    $op     = static::persistenceOptions();
    $cb     = static::persistenceSave();

    // Use standard persistence on DB layer
    $cb = $cb ? Closure::bind($cb, $this) : [$this,'persistenceSaveDefault'];
    return $cb($table,$op);
  }
49899
def save_object!(object, objectID = nil, request_options = {})
      res = save_object(object, objectID, request_options)
      wait_task(res['taskID'], WAIT_TASK_DEFAULT_TIME_BEFORE_RETRY, request_options)
      res
    end
944552
public function save(string $object, ...$options)
    {
        if (!$this->exists($object)) {
            $this->registry[$object] = [];
        }

        return;
    }
1123400
public function save()
    {
        $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
        $aRDFaDeliveries = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("ardfadeliveries");

        // Delete old mappings
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $sOxIdParameter = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("oxid");
        $sSql = "DELETE FROM oxobject2delivery WHERE oxdeliveryid = '{$sOxIdParameter}' AND OXTYPE = 'rdfadeliveryset'";
        $oDb->execute($sSql);

        // Save new mappings
        foreach ($aRDFaDeliveries as $sDelivery) {
            $oMapping = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
            $oMapping->init("oxobject2delivery");
            $oMapping->assign($aParams);
            $oMapping->oxobject2delivery__oxobjectid = new \OxidEsales\Eshop\Core\Field($sDelivery);
            $oMapping->save();
        }
    }
1177898
public static function save_from_map(DataObject $record, $relation, $regField = '', $write = true)
    {
        $map = $record->toMap();
        $rel = $record->getComponent($relation);
        $changed = false;
        if (!$regField) {
            $regField = $relation;
        }

        foreach ($map as $field => $val) {
            if (preg_match('/^' . preg_quote($regField) . '\[(\w+)\]$/', $field, $match) !== false) {
                if (count($match) == 2 && isset($match[1])) {
                    $rel->setCastedField($match[1], $val);
                    $changed = true;
                }
            }
        }

        if ($changed) {
            if ($write) {
                $rel->write();
            }

            return true;
        }

        return false;
    }
547612
def save(self, obj):
        """"""
        if not obj.id:
            obj.id = uuid()

        stored_data = {
            'id': obj.id,
            'value': obj.to_data()
        }

        index_vals = obj.indexes() or {}
        for key in obj.__class__.index_names() or []:
            val = index_vals.get(key, '')
            stored_data[key] = DynamoMappings.map_index_val(val)

        table = self.get_class_table(obj.__class__)
        item = Item(table, data=stored_data)

        item.save(overwrite=True)
806358
private function savePropertiesDirectly(Remote\Model $object)
    {
        foreach ($object::getProperties() as $property_name => $meta) {
            if ($meta[Remote\Model::KEY_SAVE_DIRECTLY] && $object->isDirty($property_name)) {
                //Then actually save
                $property_objects = $object->$property_name;
                /** @var Remote\Model $property_type */
                $property_type = get_class(current($property_objects));

                $url = new URL($this, sprintf('%s/%s/%s', $object::getResourceURI(), $object->getGUID(), $property_type::getResourceURI()));
                $request = new Request($this, $url, Request::METHOD_PUT);

                $property_array = [];
                /** @var Remote\Model[] $property_objects */
                foreach ($property_objects as $property_object) {
                    $property_array[] = $property_object->toStringArray(false);
                }

                $root_node_name = Helpers::pluralize($property_type::getRootNodeName());
                $request->setBody(Helpers::arrayToXML([$root_node_name => $property_array]));

                $request->send();

                $response = $request->getResponse();
                foreach ($response->getElements() as $element_index => $element) {
                    if ($response->getErrorsForElement($element_index) === null) {
                        $property_objects[$element_index]->fromStringArray($element);
                        $property_objects[$element_index]->setClean();
                    }
                }

                //Set it clean so the following save might have nothing to do.
                $object->setClean($property_name);
            }
        }
    }
205138
def save!
      object = self.class.name.split("::").last.downcase
      data = {}

      self.class.accessor_properties.each do |property|
        data[property] = instance_variable_get "@#{property}"
      end

      API.send("update_#{object}", @id, data)
    end
813120
public function save(array $options = array())
  {
      // Do some testing before passing onto parent save method
      //if($this->category === null || $this->category->exists === false)
      //{
          //throw new DomainException('Post must be assigned a Category');
      //}

      if(!$this->exists)
      {
        $this->recordEvents(new PostWasCreatedEvent($this));
      }

      $saved = parent::save($options);

      return $saved;
  }
1226740
function save(Model $instance, array $data)
    {
        // First transform data, passing false as a second parameter to allow partial objects.
        // This is important: this save() can be the second one called in the same request
        // for any field which formatter required a delay in his execution.
        $data = $this->applyTransformers($data, false);

        // Then handle manually ignored attributes...
        if(count($this->ignoredAttributes)) {
            $data = collect($data)->filter(function ($value, $attribute) {
                return array_search($attribute, $this->ignoredAttributes) === false;
            })->all();
        }

        // Finally call updater
        return app(EloquentModelUpdater::class)
            ->initRelationshipsConfiguration($this->getFormListFieldsConfiguration())
            ->update($instance, $data);
    }
1094202
def save(*args)
      # Go through changed attributes and call save_attribute for
      # those only
      changes.each do |key, values|
        save_attribute(key, values[1], *args)
      end

      # Go through and only save the loaded relationships, since
      # only those would be modified.
      self.class.relationships.each do |name, options|
        save_relationship(name, *args)
      end

      # No longer a new record
      @new_record = false

      true
    end
850627
public function save(Domain $model): void
    {
        if (!$model->save()) {
            throw new \RuntimeException($this->i18n->t('setrun/sys', 'Saving error'));
        }
    }
506847
public function save()
    {
        $objectHash = spl_object_hash($this);
        if (array_key_exists($objectHash, self::$saved)) {
            return true;
        }

        self::$saved[$objectHash] = true;

        $data = [];
        $validation = [];
        $one2many = AttributeType::ONE2MANY;
        $many2many = AttributeType::MANY2MANY;
        /* @var $attr AbstractAttribute */
        foreach ($this->getAttributes() as $key => $attr) {
            if ($attr->isRequired() && !$attr->hasValue()) {
                $ex = new ValidationException(ValidationException::VALIDATION_FAILED);
                $ex->addError($key, ValidationException::REQUIRED);
                $validation[$key] = $ex;
                continue;
            }

            if (!count($validation) && !$this->isInstanceOf($attr, $one2many) && !$this->isInstanceOf($attr, $many2many)) {
                if ($attr->getStoreToDb()) {
                    $data[$key] = $attr->getDbValue();
                }
            }
        }

        // Throw EntityException with invalid attributes
        if (count($validation)) {
            $attributes = [];
            foreach ($validation as $attr => $error) {
                foreach ($error as $key => $value) {
                    $attributes[$key] = $value;
                }
            }
            $ex = new EntityException(EntityException::VALIDATION_FAILED, [get_class($this), count($validation)]);
            $ex->setInvalidAttributes($attributes);
            throw $ex;
        }

        /**
         * Insert or update
         */
        $mongo = $this->entity()->getDatabase();
        if (!$this->exists()) {
            $data['_id'] = $mongo->isId($data['id']) ? $mongo->id($data['id']) : $mongo->id();
            $data['id'] = (string)$data['_id'];
            $mongo->insertOne(static::$collection, $data);
            $this->id = $data['id'];
        } else {
            $where = ['_id' => $mongo->id($this->id)];
            $mongo->update(static::$collection, $where, ['$set' => $data], ['upsert' => true]);
        }

        /**
         * Now save One2Many values
         */
        foreach ($this->getAttributes() as $attr) {
            /* @var $attr One2ManyAttribute */
            if ($this->isInstanceOf($attr, AttributeType::ONE2MANY) && $attr->isLoaded()) {
                foreach ($attr->getValue() as $item) {
                    $item->getAttribute($attr->getRelatedAttribute())->setValue($this);
                    $item->save();
                }
                /**
                 * The value of one2many attribute must be set to null to trigger data reload on next access.
                 * This is necessary when we have circular references, and parent record does not get it's many2one ID saved
                 * until all child referenced objects are saved. Only then can we get proper links between referenced classes.
                 */
                $attr->setValue(null, true);
            }
        }

        /**
         * Now save Many2Many values
         */
        foreach ($this->getAttributes() as $attr) {
            /* @var $attr Many2ManyAttribute */
            if ($this->isInstanceOf($attr, AttributeType::MANY2MANY)) {
                $attr->save();
            }
        }

        // Now that this entity is saved, remove it from save log
        unset(self::$saved[$objectHash]);

        return true;
    }
659928
public static void saveMapping(final Writer out,
                                   final DSLMapping mapping) throws IOException {
        for (DSLMappingEntry dslMappingEntry : mapping.getEntries()) {
            out.write(dslMappingEntry.toString());
            out.write("\n");
        }
    }
830886
public function save($obj, $where = [], $isUpdate = false)
    {
        $this->startProfiling();

        $result = parent::save($obj, $where, $isUpdate);

        $this->endProfiling('save', $result);
        $this->clearParams();

        return $result;
    }
675950
def save
      raise EntityModelIsNotPersistedError unless entity.persisted?

      if persisted?
        return false unless changed?
        update
      else
        create
      end

      @previously_changed = changes
      @changed_attributes.clear

      true
    end