Perform a model update operation.

@param  \Nova\Database\ORM\Builder  $query
@param  array  $options
@return bool|null
331897
protected function performUpdate(Builder $query, array $options = [])
    {
        $dirty = $this->getDirty();

        if (count($dirty) > 0) {
            if ($this->fireModelEvent('updating') === false) {
                return false;
            }

            if ($this->timestamps && array_get($options, 'timestamps', true)) {
                $this->updateTimestamps();
            }

            $dirty = $this->getDirty();

            if (count($dirty) > 0) {
                $this->setKeysForSaveQuery($query)->update($dirty);

                $this->fireModelEvent('updated', false);
            }
        }

        return true;
    }
692110
public function apply(Builder $query, $or = false)
    {
        $field_alias = $this->field_alias;

        if(is_array($this->value))
        {
            if($or)
            {
                $query->orWhereIn($field_alias, $this->value);
            }
            else
            {
                $query->whereIn($field_alias, $this->value);
            }
        }
        else
        {
            if($or)
            {
                $query->orWhere($field_alias, '=', $this->value);
            }
            else
            {
                $query->where($field_alias, '=', $this->value);
            }
        }
    }
484091
public function execute(QueryBuilderCache $queryBuilderCache, array $options = [])
    {
        // Reconnect the connection in case isn't connected yet.
        $this->reconnect();

        $queryStatement = new QueryStatement($queryBuilderCache);

        if ($queryStatement->getCollection()) {
            $startTime = microtime(true);
            $result = $this->platformExecuteHandler($queryStatement, $options);

            $queryStatement->setDuration($startTime);
            $queryStatement->setAffectedDocuments($this->getAffectedDocuments());
            $queryStatement->setLastInsertId($this->getLastInsertId());

            $this->queriesCache[] = $queryStatement;

            if ($queryStatement->hasErrors()) {
                if ($this->debugEnabled) {
                    throw new RuntimeException($queryStatement->getLatestErrorMessage(),
                        $queryStatement->getLatestErrorCode());
                }
            }

            return (bool)$result;
        }

        return false;
    }
536318
protected function updateTransaction($query, $update, $options)
    {
        return $this->transaction_collection->updateOne($query, $update, $options);
    }
1135335
public function search($query = '', $options = null): ResultSet
    {
        return $this->getType()->search($query, $options = null);
    }
219182
protected function performInsert(EloquentBuilder $query, array $options = [])
    {
        if ($this->isMoved === false) {
            $this->position = $this->position !== null ? $this->position : $this->getNextAfterLastPosition();
            $this->real_depth = $this->getNewRealDepth($this->parent_id);
        }

        return parent::performInsert($query, $options);
    }
1091945
public static function ExecuteQuery ($query, array $conditions = [], array $values = [], array $options = []) {
		$options += $options + static::GetDefaultOptions();
		return DBI::ExecuteQuery($query, $conditions, $values, $options);
	}
367925
public function update($options = array())
    {
        $ret = $this->conn()->selectCollection($this->table_name)->update($this->where, $this->data, $options);
        $this->sql = array('table'=> $this->table_name,'where'=>$this->where, 'update_data'=> $this->data);

        $this->_clear_var();
        return $ret;
    }
435254
public function search(\Cake\ORM\Query $query, $options = [])
    {
        $_query = $this->Controller->request->query;
        $this->Controller->request->data = $_query;

        $params = $_query;
        $filters = $this->_normalize($this->config('filters'));

        foreach ($filters as $field => $options) {
            $hash = Hash::get($params, $options['column']);
            if (!empty($hash)) {
                $key = $this->_buildKey($field, $options);
                $value = $this->_buildValue($field, $options, $params);

                $query->where([$key => $value]);

                $this->_setValue($field, $options, $params);
            }
        }

        return $query;
    }
110461
public function query( SqlInterface $query, $options = 0 )
    {

        $options += $options & ( self::RECONNECT_AS_REQUIRED | self::RECONNECT_NO ) ? 0 : self::RECONNECT_DEFAULT;

        $this->numQuerys++;

        $timings = array();
        $timings['start'] = microtime( true );

        $sql = $query->parse( $this );
        $timings['query_parsed'] = microtime( true );

        $this->debug->emit( Debug::INFO, self::QUERY_PARSED, $sql );

        // debugging search path pest
        // $search_path = pg_query( $this->resource->get(), "SHOW search_path"); $result = pg_fetch_row( $search_path ); d_pr( $result );

        // set exception
        $resource = $this->resource->get( $options & self::RECONNECT_AS_REQUIRED );

        try {

            // really ghetto debuggin for when shit really hits the fan
            // file_put_contents( '~/sqllog.out', "{$sql}\n\n", FILE_APPEND );

            // execute query
            if( false === $result = @pg_query( $resource, $sql ) ) {
                throw new \Exception();
            }

        } catch( \Exception $e ) {

            $exceptionFactory = new QueryExceptionFactory( $resource, $sql, $this->debug );
            throw $exceptionFactory->get();

        }

        $timings['query_executed'] = microtime( true );
        $timings['total'] = $timings['query_executed'] - $timings['start'];
        $timings['parsing'] = $timings['query_parsed'] - $timings['start'];
        $timings['total'] = $timings['query_executed'] - $timings['query_parsed'];

        $this->debug->emit( self::QUERY_OK, $sql, $timings );

        $resultResourceObject = new Result( $result, $this, $query, $timings );

        return $resultResourceObject;

    }
962616
public function createSearch($query = '', $options = null, BuilderInterface $builder = null)
    {
        $search = new Search($this->getClient(), $builder);
        $search->addIndex($this);
        $search->setOptionsAndQuery($options, $query);

        return $search;
    }
871172
public function queryValue($query, $options = array())
    {
        $statement = $this->_runQuery($query, $options);
        return $statement->fetch(\PDO::FETCH_COLUMN);
    }
201617
public function processUpdateJobFromQuery($query, array $update = [ ], $report_email = false, $postback_url = false, array $options = [ ]) {
        return $this->processUpdateJob('query', $query, $update, $report_email, $postback_url, [ ], $options);
    }
481429
public function collect($query, $options = [])
  {
    if (!$this->getNyaa()->canProvideAllData()) {
        return $this->collectRecursive($query, $options);
    }


    return $this->collectSingleFeed($query, $options);
  }
417851
public function findAndModify(array $query, array $update = array(), array $fields = null, array $options = array())
    {
        $document = new Document($query, $this);
        $findAndModify = $document->findAndModify($update, $fields, $options);

        return $findAndModify;
    }
916026
protected function performUpdate(Builder $query)
    {
        // If the updating event returns false, we will cancel the update operation so
        // developers can hook Validation systems into their models and cancel this
        // operation if the model does not pass validation. Otherwise, we update.
        if ($this->fireModelEvent('updating') === false) {
            return false;
        }

        // First we need to create a fresh query instance and touch the creation and
        // update timestamp on the model which are maintained by us for developer
        // convenience. Then we will just continue saving the model instances.
        if ($this->usesTimestamps()) {
            $this->updateTimestamps();
        }

        // Once we have run the update operation, we will fire the "updated" event for
        // this model instance. This will allow developers to hook into these after
        // models are updated, giving them a chance to do any special processing.
        $dirty = $this->getDirty();

        if (count($dirty) > 0) {
            // If dirty attributes contains binary field
            // extract binary fields to new array
            $this->updateBinary($query, $dirty);

            $this->fireModelEvent('updated', false);
        }

        return true;
    }
675346
public function queryAssoc($query, $options = array())
    {
        $statement = $this->_runQuery($query, $options);
        return $statement->fetch(\PDO::FETCH_ASSOC);
    }