Persist the entity in the database.

@throws \InvalidArgumentException

@return false|mixed
543029
public function execute()
    {
        $entity = $this->aggregate->getEntityObject();
        $wrappedEntity = $this->aggregate->getWrappedEntity();
        $mapper = $this->aggregate->getMapper();

        if ($mapper->fireEvent('storing', $wrappedEntity) === false) {
            return false;
        }

        $this->preStoreProcess();

        /*
         * We will test the entity for existence
         * and run a creation if it doesn't exists
         */
        if (!$this->aggregate->exists()) {
            if ($mapper->fireEvent('creating', $wrappedEntity) === false) {
                return false;
            }

            $this->insert();

            $mapper->fireEvent('created', $wrappedEntity, false);
        } elseif ($this->aggregate->isDirty()) {
            if ($mapper->fireEvent('updating', $wrappedEntity) === false) {
                return false;
            }
            $this->update();

            $mapper->fireEvent('updated', $wrappedEntity, false);
        }

        $this->postStoreProcess();

        $mapper->fireEvent('stored', $wrappedEntity, false);

        // Once the object is stored, add it to the Instance cache
        $key = $this->aggregate->getEntityKeyValue();

        if (!$mapper->getInstanceCache()->has($key)) {
            $mapper->getInstanceCache()->add($entity, $key);
        }

        $this->syncForeignKeyAttributes();

        $wrappedEntity->unwrap();

        return $entity;
    }
797396
public function save()
    {
        $query = new QueryBuilder(self::$_connection);

        if($this->_isInsert) {
            $query->insert($this->getTable())
                  ->values($this->_changed);

            $id = self::$_connection->insert($query->getQuery());
            $this->_data[$this->_primaryKey] = $id;

            $this->_isInsert = false;
            $this->_changed  = [];

            return;
        }

        $query->update($this->getTable())
              ->set($this->_changed)
              ->where([
                  $this->_primaryKey => $this->_data[$this->_primaryKey]
              ])
              ->execute();

        $this->_changed = [];
    }
319164
function save()
    {
        if ($this->id != false || $this->id != 0) {
            return $this->update();
        } else {
            return $this->insert();
        }
    }
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.');
		}
	}
700607
public function save($entity) {
        $this->load();
        $mapper = MapperBuilder::buildFromClassName($this->mapping, get_class($entity));
        if (is_null($entity->getId())) {
            $affectedRows = $this->insertEntity($entity, $mapper);
        } else {
            $affectedRows = $this->updateEntity($entity, $mapper);
        }
        if (0 < $affectedRows) {
            return true;
        } else {
            return false;
        }
    }
83427
final public function save()
    {
        $pre = $this->preSave();
        if ($pre === false) {
            $this->logger->error(sprintf(
                'Can not save object "%s:%s"; cancelled by %s::preSave()',
                $this->objType(),
                $this->id(),
                get_called_class()
            ));
            return false;
        }

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

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

        return true;
    }
204013
protected function persist()
    {
        $this->db->beginTransaction();

        try {
            $user = $this->model->find($this->selectedUser);
            $user->update(['password' => Hash::make($this->password)]);
        } catch (Exception $e) {
            $this->db->rollBack();
            $this->warn('Could not persist to the database: ' . $e->getMessage());
        }

        $this->db->commit();
        $this->info('Password Updated');

    }
272220
protected function persist($entity)
    {
        $manager = $this->getDoctrine()->getManager();
        $manager->persist($entity);
        $manager->flush();
    }
1128085
public function saveAll(array $entities): void
    {
        if ([] === $entities) {
            return;
        }
        foreach ($entities as $entity) {
            if (false === $entity instanceof EntityInterface) {
                throw new \InvalidArgumentException(
                    'Found invalid $entity was not an EntityInterface, was ' . \get_class($entity)
                );
            }
            $this->entityManager->persist($entity);
        }
        $this->entityManager->flush();
    }
770038
public function persist()
    {
        $this->validate();

        $patches = $this->jsonPatch->generateArrayAdd($this->getPath(), $this->data, true);
        $this->dataSource->save($this->process, $patches);

        $this->data = [];
    }
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;
    }
999990
public function save()
	{
		$this->db->begin();
		foreach($this->data as $item)
		{
			$this->db->insert($this->tableName,$item);
		}
		$this->db->commit();
		return true;
	}
1256757
public function persistEntities()
    {
        foreach ($this->entityManager->getUnitOfWork()->getIdentityMap() as $className => $entities) {
            if ($className === $this->entityClassName) {
                $this->entityManager->flush($entities);
                return;
            }
        }
    }
1163580
public function commit(): bool {
        if ($this->transactionExists) {
            $commited = $this->pdo->commit();
            $this->transactionExists = !$commited;
            return $commited;
        }
        return false;
    }
363855
public function Save(){
        if($this->transactionActive) {
            try {
                $this->commit();
                $this->exec("SET FOREIGN_KEY_CHECKS = 1;");
            } catch (\Exception $e) {
                $this->rollBack();
                echo $e->getMessage();
            }

            $this->transactionActive = false;
        }

        return false;
    }
1371781
public function save()
	{
		$sQuery = $this->_prepare();

		if (preg_match('/INSERT INTO/i', $sQuery)) {

			$oDb = self::connect();
			$oDb->exec($sQuery);
			$this->flush();
			return $oDb->lastInsertId();
		}
		else {

			$this->flush();

			if ($this->_mWhere instanceof Where) { $this->_mWhere->flush(); }

			return self::connect()->exec($sQuery);
		}

	}
644205
public function save() :bool {
		
		// if an id already exists
		if($this->_['id']) {
			// we can update and return the number of affected rows (0 on error, 1 on success)
			return (bool) self::_update()
				->set($this->__toArray(true, true))
				->where(['id'=>$this->_['id']])
				->execute();
		}
		// this is a new record
		else {
			// try to insert it
			$inserted_object = self::create($this->__toArray(true, true));
			// if insertion succeeded, return true
			if($inserted_object) {
				// clone ourselves with what the database returneds, a full fledged object
				$this->replicate($inserted_object);
				// return success
				return true;
			}
			// didnt insert
			else {
				// failure feedback
				return false;
			}
		}
		
	}