Persists this object to the database. Each field knows how to store
        itself so we don't have to worry about it
554441
def save(self):
        '''  '''
        redis = type(self).get_redis()
        pipe = to_pipeline(redis)

        pipe.hset(self.key(), 'id', self.id)

        for fieldname, field in self.proxy:
            if not isinstance(field, Relation):
                field.save(getattr(self, fieldname), pipe, commit=False)

        pipe.sadd(type(self).members_key(), self.id)

        pipe.execute()

        if self.notify:
            data = json.dumps({
                'event': 'create' if not self._persisted else 'update',
                'data': self.to_json(),
            })
            redis.publish(type(self).cls_key(), data)
            redis.publish(self.key(), data)

        self._persisted = True

        return self
113410
async def save(self, db):
        
        kwargs = {}
        for col in self._auto_columns:
            if not self.has_real_data(col.name):
                kwargs[col.name] = await col.auto_generate(db, self)
        self.__dict__.update(kwargs)

        # we have to delete the old index key
        stale_object = await self.__class__.load(db, identifier=self.identifier())
        d = {
            k: (v.strftime(DATETIME_FORMAT) if isinstance(v, datetime) else v)
            for k, v in self.__dict__.items()
        }
        success = await db.hmset_dict(self.redis_key(), d)
        await self.save_index(db, stale_object=stale_object)
        return success
1035343
public function save(Persistable $persistable) : void
    {
        $data = $this->serializer->serialize($persistable);

        $success = $this->connector->set($this->key, $data);

        if (!$success) {
            throw new RuntimeException('Failed to save persistable'
                . ' to the database.');
        }
    }
1288068
public function store() {
		$this->_storePrecheck();
		$model = $this->loadModel($this->params['model']);
		$fileData = StorageUtils::fileToUploadArray($this->args[0]);
		$entity = $model->newEntity([
			'adapter' => $this->params['adapter'],
			'file' => $fileData,
			'filename' => $fileData['name']
		]);

		if ($model->save($entity)) {
			$this->out('File successfully saved!');
			$this->out('UUID: ' . $entity->id);
			$this->out('Path: ' . $entity->path());
		} else {
			$this->abort('Failed to save the file.');
		}
	}
236585
def save(_options = {})
      self.class.create_table

      if new_record?
        conditions = { unless_exists: [self.class.hash_key] }
        conditions[:unless_exists] << range_key if range_key

        run_callbacks(:create) { persist(conditions) }
      else
        persist
      end
    end
833968
def persist(self, key, value):
        
        encoded = self.encoding.encode(value)
        self.__set_or_create(key, encoded)
        self.__increment_last_updated()
567264
public function save ()
    {
        $Statement = $this->dbTable->getSql()->prepareStatementForSqlObject($this->sqlInsert);
        $Statement->execute();
        $this->id = $this->dbTable->getAdapter()->getDriver()->getConnection()->getLastGeneratedValue();
    }
34795
protected function _storeData() {
		if ($this->_currentCellIsDirty) {
			$this->_currentObject->detach();

			$this->_cellCache[$this->_currentObjectID] = igbinary_serialize($this->_currentObject);
			$this->_currentCellIsDirty = false;
		}
		$this->_currentObjectID = $this->_currentObject = null;
	}
530755
def save(self):
        
        props = self.deflate(self.__properties__)
        query = "MATCH ()-[r]->() WHERE id(r)={self} "
        for key in props:
            query += " SET r.{0} = {{{1}}}".format(key, key)
        props['self'] = self.id

        db.cypher_query(query, props)

        return self
234115
def persist(self, context):
		""""""
		
		D = self._Document
		document = context.session[self.name]
		
		D.get_collection().replace_one(D.id == document.id, document, True)
900353
def save_object_to_db(self,
                          obj: Any,
                          table: str,
                          fieldlist: Sequence[str],
                          is_new_record: bool) -> None:
        """"""
        if is_new_record:
            pkvalue = getattr(obj, fieldlist[0])
            if pkvalue is None:
                self.insert_object_into_db_pk_unknown(obj, table, fieldlist)
            else:
                self.insert_object_into_db_pk_known(obj, table, fieldlist)
        else:
            self.update_object_in_db(obj, table, fieldlist)
924057
private function storeCurrentItem() : void
    {
        $key = $this->iterator->key();

        if ($key === null) {
            return;
        }

        $this->items[$key] = $this->iterator->current();
    }
917246
public function persist(): void
    {
        foreach ($this->create() as $seed) {
            $this->seeder->persist($seed);
            $this->persistedSeeds++;
        }

        $this->seeder->flush();
    }
915941
def save(self):
        
        ret = False

        # we will only use the primary key if it hasn't been modified
        pk = None
        if self.schema.pk.name not in self.modified_fields:
            pk = self.pk

        if pk:
            ret = self.update()
        else:
            ret = self.insert()

        return ret
70165
def save(self):
        
        with Repo.db:
            self._do_save()
            our_name = inflector.singularize(Repo.table_name(self.__class__))
            for record in self._related_records:
                if not self._id:
                    related_key = associations.foreign_keys_for(
                        record.__class__)[our_name]
                    setattr(record, related_key, self.__id)
                record._do_save()
            for record in self._delete_related_records:
                record._do_destroy()
        self._finish_save()
508741
def save(self, commit=True):
        """"""

        # walk through the document fields
        for field_name, field in iter_valid_fields(self._meta):
            setattr(self.instance, field_name, self.cleaned_data.get(field_name))

        if commit:
            self.instance.save()

        return self.instance
833845
public function save()
    {
        $collectionName = $this->intermediateCollection;

        $existingIds = [];
        $firstEntityId = $this->getParentEntity()->id;
        foreach ($this->getValue() as $item) {
            if ($item instanceof AbstractEntity && !$item->exists()) {
                $item->save();
            }

            if ($item instanceof AbstractEntity) {
                $secondEntityId = $item->id;
            } else {
                $secondEntityId = $item;
            }

            $existingIds[] = $secondEntityId;

            $data = [
                $this->thisField => $firstEntityId,
                $this->refField  => $secondEntityId
            ];

            try {
                Entity::getInstance()->getDatabase()->insertOne($collectionName, $this->arr($data)->sortKey()->val());
            } catch (BulkWriteException $e) {
                // Unique index was hit and an exception is thrown - that's ok, means the values are already inserted
                continue;
            }
        }

        /**
         * Remove old links
         */
        $removeQuery = [
            $this->thisField => $firstEntityId,
            $this->refField  => [
                '$nin' => $existingIds
            ]
        ];
        Entity::getInstance()->getDatabase()->delete($collectionName, $removeQuery);

        /**
         * The value of many2many attribute must be set to 'null' to trigger data reload on next access.
         * If this is not done, we may not have proper links between the 2 entities and it may seem as if data was missing.
         */
        $this->setValue(null);
    }