Persist this document to the remote server

@return self
556079
public function save()
    {
        if (empty($this->attributes->guid)) {
            $this->attributes->guid = $this->createGuid();
        }

        // expand link template
        $urn = self::URN_SAVE;
        $link = $this->edit($urn);
        if (!$link) {
            throw new LinkException("Unable to find link $urn - have you loaded the document yet?");
        }
        $url = $link->expand(array('guid' => $this->attributes->guid));

        // create a saveable version of this doc
        $json = new \StdClass();
        $json->version = $this->version;
        $json->attributes = $this->attributes;
        $json->links = new \StdClass();
        foreach ($this->links as $relType => $links) {
            if (!in_array($relType, self::$_staticLinkNames)) {
                $json->links->$relType = $links;
            }
        }

        // remote save
        $resp = $this->_request('put', $url, $json);
        if (empty($resp->url)) {
            $data = ['url' => $url, 'body' => json_encode($json)];
            throw new RemoteException('Invalid PUT response missing url!', $data);
        }

        // re-load doc
        $this->href = $resp->url;
        $this->load();
        return $this;
    }
971372
public function save(){
        $this->_contentArray =  array_merge($this->_codesBeforeEditArea, $this->_editArea, $this->_codesAfterEditArea);
        return $this;
    }
1156786
protected function persist() {
		$record = SentEmail::create(array(
			'To' => $this->To(),
			'From' => $this->From(),
			'Subject' => $this->Subject(),
			'Body' => $this->Body(),
			'CC' => $this->CC(),
			'BCC' => $this->BCC(),
			'SerializedEmail' => serialize($this)
		));		
		$record->write();

		return $record;
	}
496613
public function setToday(): self
	{
		return $this->modifyClone()->setDate((int) date('Y'), (int) date('m'), (int) date('d'));
	}
27640
def _persist(self):
        """"""
        with open(self.file, 'w') as f:
            json.dump({
                'client': self.client,
                'creds': self.creds,
                'config': self.config
            }, f)
23010
public function connect(): self
    {
        if ($this->pdoInstance !== null) {
            return $this;
        }

        // Build a database connection if we don't have one connected
        $this->setPdoInstance($this->getAdapter()->connect($this->getAdapterConfig()));

        return $this;
    }
1030663
public function store()
    {
        $this->authorize('create', Block::class);
        $input = $this->validator->validate('create');
        try {
            $block = $this->repository->create($input, auth()->user());
            return $this->respondWithSuccess($block, new BlockTransformer);
        } catch (RepositoryValidationException $e) {
            return $this->respondWithError($e->getMessage());
        }
    }
673196
protected function createRelsFolderAndFile()
    {
        $this->relsFolder = $this->createFolder($this->rootFolder, self::RELS_FOLDER_NAME);

        $this->createRelsFile();

        return $this;
    }
1154074
public function persist($entity)
    {
        $entityArray = $this->toArray($entity);
        $instance    = $this->getInstanceFromIdentityMap($entity);

        if ($instance) {
            $this->fillExistingInstanceFromEntityArray($instance, $entityArray);
        }
        if (!$instance) {
            $instance = $this->createInstanceFromEntityArray($entityArray);
        }
        $this->persistanceQueue[] = $instance;

        return $this;
    }
1274016
public function persist(): bool
    {
        $success = true;
        foreach ($this->values as $key => $value) {
            $success &= $this->writeOption($key, $value);
        }

        return $success;
    }
709724
public function persist(object $document) : void
    {
        $class = $this->dm->getClassMetadata(get_class($document));
        if ($class->isMappedSuperclass || $class->isQueryResultDocument) {
            throw MongoDBException::cannotPersistMappedSuperclass($class->name);
        }
        $visited = [];
        $this->doPersist($document, $visited);
    }
405701
public function commit() {
		
		if(null === $this -> connection) {
			$this -> connect();
		}

		$this -> connection -> commit();
		$this -> connection -> autocommit(true);

		return $this;
	}
998826
function save() {
		$fw=Base::instance();
		if ($this->flag) {
			if (!is_dir($dir=$fw->get('TEMP')))
				mkdir($dir,Base::MODE,TRUE);
			$this->count++;
			$fw->write($dir.'/'.
				$fw->hash($fw->get('ROOT').$fw->get('BASE')).'.'.
				$fw->hash($this->file).'-'.$this->count.'.png',
				$this->dump());
		}
		return $this;
	}
651581
public function persist(): bool
    {
        $success = true;
        foreach ($this->repositories as $repository) {
            $success &= $repository->persist();
        }

        return $success;
    }
537213
public function setDocument($url, RemoteDocument $document)
    {
        // Process the context
        if (isset($document->document->{'@context'}) && is_object($document->document->{'@context'})) {
            $this->processContext((array)$document->document->{'@context'});
        }

        // Save the document to the cache
        $docUrlHash     = $this->getCacheHash($url, self::SLOT_DOC);
        $cachedDocument = Cache::getAdapter()->getItem($docUrlHash);
        $cachedDocument->set($document);
        Cache::getAdapter()->save($cachedDocument);

        // Return the document
        return $document;
    }
69582
public function save()
    {

        $fields = array_except($this->attributes, ["_index", "_type", "_id", "_score"]);

        if ($this->exists()) {

            // Update the current document

            $this->newQuery()->id($this->getID())->update($fields);

        } else {

            // Check if model key exists in items

            if (array_key_exists("_id", $this->attributes)) {
                $created = $this->newQuery()->id($this->attributes["_id"])->insert($fields);
                $this->_id = $this->attributes["_id"];
            } else {
                $created = $this->newQuery()->insert($fields);
                $this->_id = $created->_id;
            }

            $this->setConnection($this->getConnection());
            $this->setIndex($created->_index);

            // Match earlier versions

            $this->_index = $created->_index;
            $this->_type = $this->type;

            $this->exists = true;
        }

        return $this;
    }
1132300
public function saveDocument(string $id, Document $document): self
    {
        $this->documents[$id] = $document;
        $this->filesystem->put($this->getDocumentPath($id), $this->format->stringify($document->getArrayCopy()));

        return $this;
    }