Before update callback. Manipulate the new data here.

@param Array $args The new data is in $args[1]
@return Void
337923
public function beforeUpdate(array &$args) {
        $data = &$args[1];
        foreach ($this->_fields as $field) {
            if (!empty($data[$field])) {
                $data[$field] = $this->filter($data[$field], $this->getConfig());
            }
        }
    }
585400
public function afterInsert(array &$args) {
        $data = $args[1];
        $primaryKey = &$args[2];

        // Check if an email address was changed. If so, send a validation email
        if (array_key_exists('email', $data) && !empty($data['email'])) {
            $this->_onEmailChange($data['email']);
        }

        // Save the password that was stored in beforeInsert()
        if ($this->_password) {
            $authLocalModel = new Model_AuthLocal();
            $newAuthLocalData = array(
                'password' => $this->_password,
                'user_id'  => $primaryKey
            );
            // Save the AuthLocal record
            $authLocalModel->insert($newAuthLocalData);
        }
    }
864418
public function evaluateArgs(array $args) : void
    {
        array_shift($args);

        if (count($args) < 2) {
            $this->out->red("Not enough arguments: expects 2, got ".(count($args) - 1).".");
            return;
        }

        $this->setName($args[0]);
        $this->setLocation($args[1]);
        if (isset($args[2])) {
            $this->additionalArgs(array_slice($args, 2, count($args)));
        }

        return;
    }
809948
public function update( array $args ) {

		/**
		 * @var \WP_Error|array $response
		 * @var string          $context
		 * @var string          $class
		 */
		list( $response, $context, $class ) = $args;
		$http_args = isset( $args[ 3 ] ) ? $args[ 3 ] : [];
		$url       = isset( $args[ 4 ] ) ? $args[ 4 ] : '';

		if ( $this->is_error( $response, (array) $http_args ) ) {
			return $this->log_http_error( $response, $context, $class, $http_args, $url );
		}

		if ( $this->is_cron( $response, $url ) ) {
			return $this->log_cron( $response, $context, $class, $http_args, $url );
		}

		return new NullLog();
	}
618944
public function preUpdate(LifecycleEventArgs $args)
    {
        if ($args->getObject() instanceof BlockInterface) {
            $this->getService($args)->preUpdate($args->getObject());
        }
    }
253183
public function init($args){
		$this->params = $args;
		

		$this->AUDIT_ENTITY = new AUDIT_ENTITY();
		$this->AUDIT_ENTITY->init($this->params);
		/*
		echo __METHOD__.'@'.__LINE__.'$args<pre>['.var_export($args, true).']</pre>'.'<br>'; 
		*/		
		return;
	}
755990
protected function init_args($args)
    {
        parent::init_args($args);

        $this->env = $this->get_env_for_write_or_fail();
        $api = new Salts();

        try {
            $this->salts = $api->collect();
        } catch (Exception $e) {
            WP_CLI::error($e->getMessage());
        }
    }
1267952
public function preFlush(PreFlushEventArgs $args)
    {
        $em = $args->getEntityManager();
        $unitOfWork = $em->getUnitOfWork();

        foreach ($unitOfWork->getScheduledEntityInsertions() as $entity) {
            $this->updateCompressedHubProperty($em, $entity);
        }

        if (empty($this->originalData)) {
            return;
        }

        foreach ($this->originalData as $classEntity => $hashList) {
            foreach ($hashList as $hash => $valueList) {
                $value = array_pop($valueList);
                $entity = $unitOfWork->tryGetByIdHash($value['id'], $classEntity);
                if (!$entity) {
                    continue;
                }

                $is_updated = $this->updateCompressedHubProperty($em, $entity);
                if ($is_updated && !$unitOfWork->isScheduledForUpdate($entity)) {
                    $unitOfWork->scheduleForUpdate($entity);
                }
            }
        }
    }
1240341
public function update( array $args ) {

		switch ( current_filter() ) {
			case 'phpmailer_init' :
				return $this->on_mailer_init( $args );
			case 'wp_mail_failed' :
				return $this->on_mail_failed( $args );
		}

		return new NullLog();
	}
586000
public function beforeUpdate(&$args) {
        $model = $args[0];
        $data = &$args[1];
        $where = $args[2];
        
        foreach ($this->_relationConfig as $foreignModel => $modelRelationConfig) {
            $foreignKey = $modelRelationConfig[self::FOREIGN_KEY_COLUMN_KEY];
            $weightColumn = $modelRelationConfig[self::WEIGHT_COLUMN_KEY];
            /**
             * Only act if the foreign key field is filled, since weight is calculated per foreign key.
             * This means duplicate weight values might occur in the database, but the foreign key 
             * will always differ.
             * You should be able to add a UNIQUE INDEX to your table containing the foreign key column and the
             * weight column.
             */
            if (array_key_exists($foreignKey, $data) && $data[$foreignKey]) {
                /**
                 * If the weight column is not given in the new data, fetch it. 
                 * This is quite the pickle, since the given WHERE clause might update (and thus fetch)
                 * multiple records, but we can only provide one set of modified data to apply to every 
                 * matching record. 
                 * This is currently not fixed. If a WHERE clause is given that matches multiple records,
                 * the current weight of the first record found is used.
                 */
                if (!array_key_exists($weightColumn, $data)) {
                    $data[$weightColumn] = $this->findCurrentWeight($model, $where, $data[$foreignKey], $modelRelationConfig);
                }
            
                // only act if the foreign key column is filled, and the weight column is null
                if (!$data[$weightColumn]) {
                    $maxWeight = $this->findHighestWeight($model, $data[$foreignKey], $modelRelationConfig);
                    $data[$weightColumn] = ($maxWeight+1);
                }
            }
        }
    }
719635
private function runUpdate($args)
    {
        $cmd = new UpdateCommand($this->cwd);

        return $cmd->run(array_slice($args, 1));
    }
973462
public function afterInsert(&$args) {
        $model = $args[0];
        $data = $args[1];
        $this->afterSave($model, $data);
    }
198093
public function fill($args)
    {
        foreach (get_object_vars($this) as $key => $value) {
            foreach ($args as $argKey => $argValue) {
                if ($key == $argKey || $key == $argKey . "Name") {
                    $this->$key = $argValue;
                }
            }
        }
    }
1238148
public function beforeFetch(&$args) {
        $model = $args[0];
        $is_cms = $model->isCmsContext();
        $is_preview = $this->_isPreview() && Garp_Auth::getInstance()->isLoggedIn();

        $force = $this->_force;
        if (($is_cms || $is_preview) && !$force) {
            // don't use in the CMS, or in preview mode
            return;
        }

        $model = &$args[0];
        $select = &$args[1];

        if ($this->_blockOfflineItems) {
            $this->addWhereClause($model, $select);
        }
    }
1305549
public function handle(array $args)
    {
        $this->filter->add('themosis_admin_global', function ($data) use ($args) {
            if (! isset($data['metabox'])) {
                $data['metabox'] = [$this->id];
            } elseif (isset($data['metabox'])) {
                $data['metabox'][] = $this->id;
            }

            /*
             * Provides WP_Post data.
             */
            $data['post'] = $args['post'];

            return $data;
        });
    }
941289
public function beforeUpdate()
    {
        foreach ($this->models as $relationName => $config) {
            $this->markFilesAsPermanent($this->getRelationValues($relationName));
        }
    }
830626
public function beforeDelete(array &$args) {
        $where = $args[1];
        $exception = 'You are not allowed to delete users with a role greater than your own.';
        $rows = $this->fetchAll($where);
        foreach ($rows as $row) {
            if (!$this->_isRoleAllowed($row->{self::ROLE_COLUMN})) {
                throw new Garp_Model_Exception($exception);
            }
        }
    }