This is invoked after the record is saved.
194043
protected function afterSave()
	{
		parent::afterSave();
		Tag::model()->updateFrequency($this->_oldTags, $this->tags);
	}
532621
public function afterVersionedSave()
    {
        if ($this->wasDirty && static::$createRevisionOnSave) {
            // save a copy to history table
            $recordValues = $this->_prepareRecordValues();
            $set = static::_mapValuesToSet($recordValues);
            DB::nonQuery(
                'INSERT INTO `%s` SET %s',
                [
                    static::getHistoryTable(),
                    join(',', $set),
                ]
            );
        }
    }
107013
public function afterUpdate()
    {
        /** @var ActiveRecord $owner */
        $owner = $this->owner;

        if ($owner->isRelationPopulated('translations')) {
            $translations = $this->indexByLanguage($owner->getRelatedRecords()['translations']);
            $this->saveTranslations($translations);
        }
    }
793746
function () {
            var pos = this._savedX, newValue = Math.max(pos / this._railWidth, 0);
            if (newValue !== this._value) {
                this._value = newValue;
                this._storeValue();
            } else {
                this._notifyDataChange();
            }
            return;
        }
1250658
public function onAfterWrite()
    {
        parent::onAfterWrite();
        $owner = $this->owner;

        $owner->writePresets();

        if ($owner->ClassName == 'PlaceablePage') {
            // Save fields to related regions and blocks
            foreach ($owner->PageFields as $region) {
                $regionObject = $region->DataObject;
                foreach ($region->Fields as $field) {
                    if (isset($_POST["$field->name"])) {
                        $regionObject->{$field->original_name} = $_POST["$field->name"];
                    }
                }
                $regionObject->forceChange()->write();
                foreach ($region->Blocks as $block) {
                    $blockObject = $block->DataObject;
                    foreach ($block->Fields as $field) {
                        if (isset($_POST["$field->name"])) {
                            $blockObject->{$field->original_name} = $_POST["$field->name"];
                        }
                    }
                    $blockObject->forceChange()->write();
                }
            }
        }
    }
441761
function save(callback) {
            var model, request;

            model = this;

            this.constructor.dispatch('beforeSave', {
                data : {
                    model : this
                }
            });
            this.dispatch('beforeSave');

            this.isValid(function (isValid) {
                if (isValid) {
                    if (model.hasOwnProperty('id') && model.id !== '') {
                        request = {
                            action : 'update',
                            data : model,
                            model : model.constructor
                        };
                        model.constructor.storage.update(request, function updateCallback(data) {
                            model.constructor.dispatch('afterSave', {
                                data : {
                                    model : model
                                }
                            });

                            model.dispatch('afterSave');
                            if (callback) {
                                callback(data);
                            }
                        });
                    }
                    else {
                        request = {
                            action : 'create',
                            data : model,
                            model : model.constructor
                        };
                        model.constructor.storage.create(request, function createCallback(data) {
                            model.constructor.dispatch('afterSave', {
                                data : {
                                    model : model
                                }
                            });

                            model.dispatch('afterSave');
                            if (callback) {
                                callback(data);
                            }
                        });
                    }
                } else {
                    if (callback) {
                        callback(data);
                    }
                }
            });

        }
996843
def after_object(eng, objects, obj):
        """"""
        # We save each object once it is fully run through
        super(InvenioProcessingFactory, InvenioProcessingFactory)\
            .after_object(eng, objects, obj)
        obj.save(
            status=obj.known_statuses.COMPLETED,
            id_workflow=eng.model.uuid
        )
        db.session.commit()
512317
def post_save(self):
        """"""
        if self.run:
            self.run = False
            self.create_tasks()
            self.save()
444685
protected function afterSave()
    {
        parent::afterSave();
        CategoryListStore::instance()->top_level->clear();

        $this->checkFieldChanges('active', CategoryListStore::instance()->active);
    }
629673
function( cb ){
              if( ! self.positionField ){
                cb( null );
              } else {

                // If repositioning is required, do it
                if( self.positionField ){
                  var where, beforeId;
                  if( ! options.position ){
                    where = 'end';
                  } else {
                    where = options.position.where;
                    beforeId = options.position.beforeId;
                  }
                  self.reposition( recordWithLookups, where, beforeId, cb );
                }
              }
            }
757890
function(e) {

      if(!this.dialog) {
         this.renderDialog();
      }
		
		// Inserting new record
		this.insertNewRecord = true;
		
		this.dialog.whenFormAvailable({
			fn: function() {
				this.dialog.getForm().clear();
				this.dialog.show();
			},
			scope: this
		});
		
   }
968334
public function onBeforeWrite()
    {
        parent::onBeforeWrite();

        if (!$this->Sort) {
            if ($this->hasExtension(Versioned::class)) {
                $records = Versioned::get_by_stage(BaseElement::class, Versioned::DRAFT);
            } else {
                $records = BaseElement::get();
            }

            $records = $records->filter('ParentID', $this->ParentID);

            $this->Sort = $records->max('Sort') + 1;
        }
    }
805789
protected function __save()
    {
        foreach($this->records as $record)
        {
            $content = $this->getLogString($record);
            if($this->length > 0)
            {
                $content = mb_substr($content, 0, $this->length) . '...';
            }
            echo $content, PHP_EOL;
        }
    }
327275
private void afterRecord() {
        if (fileNamePattern != null && getRecordCounter() % splitlimit == 0) {
            try {
                endCollection();
                writer.close();
                newWriter(fileNamePattern, fileNameCounter, bufferSize, compress);
                setupEventConsumer(writer, indent);
                beginCollection();
            } catch (IOException e) {
                logger.log(Level.SEVERE, e.getMessage(), e);
            }
        }
    }
12991
public void init(Record record)
    {
        super.init(record);
        this.setMasterSlaveFlag(FileListener.RUN_IN_MASTER | FileListener.DONT_REPLICATE_TO_SLAVE);
    }
753399
def after(self, context):
        ""
        self._invoke(self._after, context)
        run.after_each.execute(context)
513410
public function afterSave()
    {
        if ($this->_relationsSaveStarted === false) {
            /** @var BaseActiveRecord $owner */
            $owner = $this->owner;
            $this->_relationsSaveStarted = true;
            // Populate relations with updated values
            foreach ($this->_newRelationValue as $name => $value) {
                $owner->populateRelation($name, $value);
            }
            try {
                foreach ($this->_relations as $relationName) {
                    if (array_key_exists($relationName, $this->_oldRelationValue)) { // Relation was not set, do nothing...
                        Yii::debug("Linking {$relationName} relation", __METHOD__);
                        /** @var ActiveQuery $relation */
                        $relation = $owner->getRelation($relationName);
                        if ($relation->multiple === true) { // Has many relation
                            $this->_afterSaveHasManyRelation($relationName);
                        } else { // Has one relation
                            $this->_afterSaveHasOneRelation($relationName);
                        }
                        unset($this->_oldRelationValue[$relationName]);
                    }
                }
            } catch (Exception $e) {
                Yii::warning(get_class($e) . ' was thrown while saving related records during afterSave event: ' . $e->getMessage(), __METHOD__);
                $this->_rollback();
                /***
                 * Sadly mandatory because the error occurred during afterSave event
                 * and we don't want the user/developper not to be aware of the issue.
                 ***/
                throw $e;
            }
            $owner->refresh();
            $this->_relationsSaveStarted = false;
        }
    }