{@inheritDoc}
@see \rocket\ei\manage\gui\EiEntryGuiListener::onSave()
167909
public function onSave(EiEntryGui $eiEntryGui) {
		if ($this->onSaveClosure !== null) {
			$this->call($this->onSaveClosure);
		}
	}
894397
public function autoSave($value = null)
    {
        if (func_num_args()) {
            $this->autoSave = $value;
            return $this;
        }
        return $this->autoSave;
    }
792035
public function afterSave(Save $event)
    {
        /** @var Entity $entity */
        $entity = $event->getTarget();
        $entity->loadRelations = false;
        $prop = $this->getPropertyName();
        $relPrk = Entity\Manager::getInstance()->get($this->getRelatedEntity())
            ->getEntity()->getPrimaryKey();
        $entPrk = $entity->getPrimaryKey();
        
        if (isset($entity->$prop) && is_array($entity->$prop)) {
            $this->beforeDelete(new Delete(['primaryKey' => $entity->$entPrk]));
            foreach ($entity->$prop as $object) {
                $relVal = $object;
                if ($object instanceof Entity) {
                    $relVal = $object->$relPrk;
                }

                Sql::createSql($entity->getAdapter())
                    ->insert($this->getRelationTable())
                    ->set(
                        [
                            $this->getForeignKey() => $entity->$entPrk,
                            $this->getRelatedForeignKey() => $relVal
                        ]
                    )
                    ->execute();
            }
        }
        $entity->loadRelations = true;
    }
1090398
function OnSave($is_insert)
	{
		// if the password has changed since load, then we want to crypt it
		// otherwise we don't want to touch it because it is already crypted
		if ($is_insert || $this->PasswordWasChanged() )
		{
			$this->_phreezer->Observe("Account-&gt;OnSave: The password has changed");
			$this->Password = base64_encode(crypt($this->Password,$this->Username));
		}
		else
		{
			$this->Password = $this->_original_password;
			$this->_phreezer->Observe("Account->OnSave: The password was not changed");
		}		

		// update the modified date
		$this->Modified = date('Y-m-d H:i:s');
		return true;
	}
1220838
protected void onClickSave() {

        Timer timer = new Timer() {

            @Override
            public void run() {

                m_aliasList.clearValidationErrors();
                m_aliasValidationStatus = VALIDATION_RUNNING;
                m_propertyValidationStatus = VALIDATION_RUNNING;
                m_aliasList.validate(new Runnable() {

                    public void run() {

                        m_aliasValidationStatus = !m_aliasList.hasValidationErrors()
                        ? VALIDATION_OK
                        : VALIDATION_FAILED;
                        update(true);

                    }
                });
                m_propertyEditor.getForm().validateAndSubmit();
            }
        };
        // slight delay so that the validation doesn't interfere with validations triggered by the change event
        timer.schedule(20);
    }
922990
public function onSave($model)
    {
        $apiRoles          = ApiRoles::firstOrNew(['role_id' => $model->id]);
        $apiRoles->enabled = (int) Input::get('enabled');
        try {
            $apiRoles->save();
        } catch (Exception $ex) {
            Log::emergency($ex);
            throw new Exception('Unable to save role.');
        }
    }
466877
def OnSave(self, event):
        """"""

        try:
            filetype = event.attr["filetype"]

        except (KeyError, AttributeError):
            filetype = None

        filepath = self.main_window.filepath
        if filepath is None:
            filetype = config["default_save_filetype"]

        if filetype is None:

            f2w = get_filetypes2wildcards(["pys", "pysu", "xls", "all"])
            __filetypes = f2w.keys()

            # Check if the file extension matches any valid save filetype
            for __filetype in __filetypes:
                if splitext(filepath)[-1][1:] == __filetype:
                    filetype = __filetype
                    break

        # If there is no filepath or no filetype is found then jump to save as

        if self.main_window.filepath is None or filetype is None:
            post_command_event(self.main_window,
                               self.main_window.SaveAsMsg)
            return

        # Save the grid

        post_command_event(self.main_window,
                           self.main_window.GridActionSaveMsg,
                           attr={"filepath": self.main_window.filepath,
                                 "filetype": filetype})

        # Update undo stack savepoint
        undo.stack().savepoint()

        # Display file save in status bar

        statustext = self.main_window.filepath.split("/")[-1] + " saved."
        post_command_event(self.main_window,
                           self.main_window.StatusBarMsg,
                           text=statustext)
942548
public function keepAlive()
        {
            while (is_resource($this->fd)) {
                if ($this->session['heartbeat_timeout'] > 0 && $this->session['heartbeat_timeout'] + $this->heartbeatStamp - 5 < time()) {
                    $this->send(self::TYPE_HEARTBEAT);
                    $this->heartbeatStamp = time();
                }

                $r = array($this->fd);
                $w = $e = null;

                if (stream_select($r, $w, $e, 5) == 0) {
                    continue;
                }

                $res    = $this->read();
                $sess   = explode(':', $res);

                if ((int) Arrays::first($sess) === self::TYPE_EVENT) {
                    unset(Arrays::first($sess), $sess[1], $sess[2]);

                    $response = json_decode(implode(':', $sess), true);
                    $name = $response['name'];
                    $data = Arrays::first($response['args']);

                    $this->stdout('debug', 'Receive event "' . $name . '" with data "' . $data . '"');

                    if (!empty($this->callbacks[$name])) {
                        foreach ($this->callbacks[$name] as $callback) {
                            call_user_func($callback, $data);
                        }
                    }
                }
            }
        }
1276741
public function save(Driver $driver, ModelInterface $model)
    {
        $this->managerFactory->setModelClass(get_class($model));
        $manager = $this->managerFactory->getManager($driver);
        $preSaveEvent = new FilterModelEvent();
        $preSaveEvent->setModel($model);
        $preSaveEvent->setManager($manager);
        $this->eventSubscriber->subscribe(Constants::PRE_SAVE, $preSaveEvent);

        try {
            $manager->save($preSaveEvent->getModel());

            $postSaveEvent = new FilterModelEvent();
            $postSaveEvent->setManager($manager);
            $postSaveEvent->setModel($model);
            $this->eventSubscriber->subscribe(Constants::POST_SAVE, $postSaveEvent);
        } catch (\Exception $exception) {
            $this->errorMessage = 'message.save_failed';

            return false;
        }

        return true;
    }
55288
public function save(){

            $this->parent->driver->setData($this->name, $this->data);

            return $this;

        }
653675
public function beforeSave(Event $event, EntityInterface $entity, ArrayObject $options): void
    {
        if (! is_callable($this->getConfig('callback'))) {
            return;
        }

        $user = call_user_func($this->getConfig('callback'));
        if (empty($user['id'])) {
            return;
        }

        // Set created_by only if that field is not set during entity creation
        if ($entity->isNew() && empty($entity->get($this->getConfig('created_by')))) {
            $entity->set($this->getConfig('created_by'), $user['id']);
        }

        // Set modified_by if that field is not set during update
        $userId = $entity->isDirty($this->getConfig('modified_by')) && !empty($this->getConfig('modified_by')) ? $entity->get($this->getConfig('modified_by')) : $user['id'];
        $entity->set($this->getConfig('modified_by'), $userId);
    }
1223725
protected function afterSave(EntityInterface $entity): void
    {
        $argv = compact('entity');
        $argv = $this->getEventManager()->prepareArgs($argv);

        $this->getEventManager()->trigger("{$this->event_prefix}_save_after", $this, $argv);
        if ($this->entity_event_prefix) {
            $this->getEventManager()->trigger("{$this->entity_event_prefix}_save_after", $this, $argv);
        }
    }
1051264
public function saveLean() {
		$fh = fopen($this->getDirname().'/'.$this->getLeanName(),'w');
		fwrite($fh, $this->leanCSS->render());	
	}
250737
public function onSave(Event\Save $event)
    {
        $success = $event->getUser()->save();
        $event->setResult( (bool)$success );
        if( $event->getResult() === false )
        {
            $event->stopPropagation(true);
        }
        return $event;
    }
1230280
public function set($key, $value, $exp = 0, $onResponse = null)
    {
        $this->getConnectionByKey($key, function ($conn) use ($key, $value, $exp, $onResponse) {
            if (!$conn->connected) {
                return;
            }
            if ($onResponse !== null) {
                $conn->onResponse->push($onResponse);
                $conn->checkFree();
            }

            $conn->writeln(
                'set ' . $this->config->prefix->value . $key . ' 0 ' . $exp . ' '
                . mb_orig_strlen($value) . ($onResponse === null ? ' noreply' : '') . "\r\n" . $value
            );
        });
    }
594296
public function afterSave(Event $event, EntityInterface $entity) {
		if ($this->_checkEvent($event) && $entity->isNew()) {
			$fileField = $this->getConfig('fileField');

			$hash = StorageUtils::getFileHash($entity->get($fileField)['tmp_name']);
			$path = $this->pathBuilder()->fullPath($entity);

			$entity->set('hash', $hash);
			$entity->set('path', $path);

			if (!$this->_storeFile($event)) {
				return;
			}

			$event->result = true;
			$event->stopPropagation();
		}
	}
702004
public function save()
	{
		if ($this->hasEventHandler('onBeforeSave')) {
			$this->onBeforeSave(new CEvent($this));
		}
		$this->flush();
		if ($this->hasEventHandler('onAfterSave')) {
			$this->onAfterSave(new CEvent($this));
		}
	}