_saveToSession

@param mixed $subject The session to save.

@access protected
@return void
343853
protected function _saveToSession($subject)
    {
        $this->mergePrincipals($subject);
        $this->mergeAuthenticationState($subject);
        $this->mergeAuthorizationState($subject);

    }
999520
protected function saveEntity($user)
    {
        if (!$user instanceof UserInterface) {
            parent::saveEntity($user);

            return;
        }

        $this->get(UserManagerInterface::class)->save($user);

        $action = $this->admin->getCurrentAction();
        $this->addFlash('success', "eavmanager.flash.{$action->getCode()}.success");
    }
843281
public function save() : void
    {
        if ($this->base instanceof Persistable) {
            $this->persister->save($this->base);

            if ($this->logger) {
                $this->logger->info('Model saved successully');
            }
        }
    }
999139
public function setSubject($subject)
    {
        if (!is_string($subject)) {
            throw new TypeException('$subject must be of type string.');
        }
        if (!($subject instanceof Subject)) {
            $this->subject = new Subject($subject);
        } else {
            $this->subject = $subject;
        }
    }
853568
protected function _success(Subject $subject, array $user)
    {
        $subject->set(['success' => true, 'user' => $user]);

        $this->_trigger('afterLogin', $subject);
        $this->_controller()->Auth->setUser($subject->user);
        $this->setFlash('success', $subject);

        return $this->_redirect(
            $subject,
            $this->_controller()->Auth->redirectUrl()
        );
    }
1108856
public function save($entity)
    {

        $objectManager = $this->getObjectManager();

        //@TODO UnitOfWork::STATE_NEW == $em->getUnitOfWork()->getEntityState($entity)
        //@see http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/working-with-objects.html#entity-state
        $objectManager->persist($entity);
        $objectManager->flush();
    }
540587
public function save()
    {
        $em = Application::getFacadeApplication()->make(EntityManagerInterface::class);
        $em->persist($this);
        $em->flush();
    }
480511
public function save($session, $config, $exists)
    {
        $this->dba->put($session['id'], $session, $config['lifetime']);
    }
610677
function saveToSession($data, $name = '') {
		if(!$name) $name = $this->owner->FormName();

		\Session::set("FormInfo.{$name}.data", $data);
	}
714257
private function pruneUses($subject)
    {
        $repository = $this->entityManager->getRepository(UsedString::class);
        $usedStrings = $repository->findBy(['subject' => $subject], ['id' => 'desc']);

        // IF there are extra used strings, prune the extras
        if (count($usedStrings) > $this->maxReuse) {
            array_map([$this->entityManager, 'remove'], array_slice($usedStrings, $this->maxReuse));
            $this->entityManager->flush();
        }
    }
700763
public function save()
    {

        $con = Propel::getWriteConnection(RecordTableMap::DATABASE_NAME);
        $con->beginTransaction();

        foreach ($this->recordsPerPlayer as $record) {
            $record->save();
        }

        $con->commit();

        RecordTableMap::clearInstancePool();
    }
666658
protected function _success(Subject $subject)
    {
        $subject->set(['success' => true, 'created' => true]);

        $this->_trigger('afterSave', $subject);
        $this->setFlash('success', $subject);

        return $this->_redirect($subject, ['action' => 'index']);
    }
1258002
protected function _ensureData(Subject $subject)
    {
        $controller = $this->_controller();
        $action = $this->_action();

        if (method_exists($action, 'viewVar')) {
            $viewVar = $action->viewVar();
        } else {
            $viewVar = 'data';
        }

        if (isset($controller->viewVars[$viewVar])) {
            return;
        }

        $key = $subject->success ? 'success' : 'error';

        $config = $action->getConfig('api.' . $key);

        $data = [];

        if (isset($config['data']['subject'])) {
            $config['data']['subject'] = Hash::normalize((array)$config['data']['subject']);

            $subjectArray = (array)$subject;
            foreach ($config['data']['subject'] as $keyPath => $valuePath) {
                if ($valuePath === null) {
                    $valuePath = $keyPath;
                }

                $keyPath = $this->_expandPath($subject, $keyPath);
                $valuePath = $this->_expandPath($subject, $valuePath);

                $data = Hash::insert($data, $keyPath, Hash::get($subjectArray, $valuePath));
            }
        }

        if (isset($config['data']['entity'])) {
            $config['data']['entity'] = Hash::normalize((array)$config['data']['entity']);

            foreach ($config['data']['entity'] as $keyPath => $valuePath) {
                if ($valuePath === null) {
                    $valuePath = $keyPath;
                }

                if (method_exists($subject->entity, $valuePath)) {
                    $data = Hash::insert($data, $keyPath, call_user_func([$subject->entity, $valuePath]));
                } elseif (isset($subject->entity->{$valuePath})) {
                    $data = Hash::insert($data, $keyPath, $subject->entity->{$valuePath});
                }
            }
        }

        if (isset($config['data']['raw'])) {
            foreach ($config['data']['raw'] as $path => $value) {
                $path = $this->_expandPath($subject, $path);
                $data = Hash::insert($data, $path, $value);
            }
        }

        if (method_exists($action, 'viewVar')) {
            $viewVar = $action->viewVar();
        } else {
            $viewVar = 'data';
        }

        $controller->set($viewVar, $data);
    }
344767
public function save($uri)
    {
        $this->connect($uri);
        //Only attempt to savePClasses if there are any.
        if (!is_array($this->pclasses)) {
            return;
        }
        if (count($this->pclasses) == 0) {
            return;
        }
        $this->savePClasses();
    }
820708
public function update(SplSubject $subject)
    {
        if ($this->hasMethod('__update') && is_callable([$this, '__update'])) {
            $this->__update($subject);
        }
    }
144809
public function setSubject($subject)
    {
        if (!$this->setHeaderFieldModel('Subject', $subject)) {
            $this->getHeaders()->addTextHeader('Subject', $subject);
        }

        return $this;
    }
746510
public function save(User $user)
    {
        if ($user->getPlainPassword()) {
            $this->setPlainTextPassword($user, $user->getPlainPassword());
        }

        $this->entityManager->persist($user);
        $this->entityManager->flush();

        if ($user->isNew() && !$user->isEmailSent()) {
            try {
                $this->userMailer->sendNewUserMail($user);
                $user->setEmailSent(true);
                $this->entityManager->flush($user);
            } catch (\Exception $e) {
                $this->logger->alert($e->getMessage());
            }
        }
        if ($user->getPasswordRequestedAt() && !$user->isEmailSent()) {
            try {
                $this->userMailer->sendResetPasswordMail($user);
                $user->setEmailSent(true);
                $this->entityManager->flush($user);
            } catch (\Exception $e) {
                $this->logger->alert($e->getMessage());
            }
        }
    }