@param      $string
@param null $params

@return QueryBuilder
436161
public function setLastQuery($string, $params = null)
    {
        $this->lastQuery = [$string, $params];
        $this->pdo->addExecutedQuery($this->lastQuery);

        return $this;
    }
684106
public function createQuery($params, $queryBuilder)
    {

        /*
         * search jobs by keywords
         */

        if (isset($params['text']) && !empty($params['text'])) {
            $search = strtolower($params['text']);
            $queryBuilder->text($search);
        }

        $queryBuilder->field('isDraft')->equals(false);

        if (isset($params['status']) &&
            !empty($params['status'])) {
            if ($params['status'] != 'all') {
                $queryBuilder->field('status.name')->equals($params['status']);
            }
        }

        if (isset($params['companyId']) &&
            !empty($params['companyId'])) {
            $queryBuilder->field('organization')->equals(new \MongoId($params['companyId']));
        }

        if (isset($params['sort'])) {
            foreach (explode(",", $params['sort']) as $sort) {
                $queryBuilder->sort($this->filterSort($sort));
            }
        }
        $queryBuilder->sort('datePublishStart.date', -1);
        return $queryBuilder;
    }
534479
public function execute($params = null) {
		if ($params === null) {
			$params = [];
		}

		try {
			$this->stmt->execute($params);

			return new QueryResult($this->stmt, $this->pdo);
		} catch (PDOException $e) {
			throw $this->exAdapter->adapt($e, $this->stmt, $params);
		}
	}
152773
public function query($query,$sqlParams=null)
    {
        $this->query =  (string)$query;
        if ($sqlParams!=null) {
            $this->sqlParams = $sqlParams;
        }
        return $this;
    }
761992
public function getQuery($queryParams)
    {
        return array_key_exists($queryParams, $this->query) ? $this->query[$queryParams] : null;
    }
1220823
public function search($params)
    {
        $searchResult = $this->getRequest()->request(
            'POST',
            $this->getRequestUrl('searches'),
            $this->getSearchQuery($params)
        );

        return $this->getInputsFromSearchResult($searchResult);
    }
1184442
public function execute(string $query, array $params = []) : object
    {
        list($query, $params) = $this->expandParamArray($query, $params);

        if (!$this->pdo) {
            $this->createException("Did you forget to connect to the database?", $query, $params);
        }

        $this->stmt = $this->pdo->prepare($query);
        if (!$this->stmt) {
            $this->pdoException($query, $params);
        }

        if ($this->options["verbose"]) {
            echo $query . "\n";
            print_r($params);
        }

        $res = $this->stmt->execute($params);
        if (!$res) {
            $this->statementException($query, $params);
        }

        return $this;
    }
1008419
public static function replaceQueryParam($param, $value, $queryString)
    {
        $parsedQuery = self::parseQueryString($queryString);
        $parsedQuery[$param] = $value;
        return http_build_query($parsedQuery);
    }
1360244
public function single($query = '', $params = null)
    {
        $query = trim($query);
        if (empty($query)) {
            $query = $this->build();
            if (!$params) {
                $params = $this->getBindValues();
            }
        }

        $this->resetAll();
        $this->lastSql = $query;

        $this->execute($query, $params);
        return $this->sQuery->fetchColumn();
    }
794460
public static function queryString($string, $options = [])
    {
        
        $joins = [];
        $selectedColumns = [];
        
//        if (is_array($options)) {
//            if (isset($options["join"])) {
//                foreach ($options["join"] as $j) {
//                    $joins["this.$j"] = self::getEntityFace()->getElement($j)->getFace();
//                }
//            }
//
//            if (isset($options["select"])) {
//                foreach ($options["select"] as $k => $j) {
//                    $basePath = is_numeric($k) ? $j : $k;
//
//                    if (!StringUtils::beginsWith("this", $basePath)) {
//                        $basePath = "this." . $basePath;
//                    }
//
//                    $basePath = substr($basePath, 0, strrpos($basePath, "."));
//
//                    self::__queryStringDoColumnRecursive($selectedColumns, $k, $j, $basePath);
//
//
//                }
//            }
//
//        }
        $qS = new \Face\Sql\Query\QueryString(self::getEntityFace(), $string, $joins, $selectedColumns);
        
        return $qS;
        
    }
707395
public function params($params = null)
    {
        if (null !== $params) {
            $this->params = $params;

            return $this;
        }

        return $this->params;
    }
820345
public function withQueryParams($params)
    {
        while (list($key, $value) = each($params)) {
            $this->queryParams[$key] = $value;
        }

        return $this;
    }
1075302
public function buildQueryString(array $parameters, array $initialQueryParameters = [], $previousKey = null)
    {
        $queryParameters = $initialQueryParameters;

        foreach ($parameters as $key => $value) {
            if (null !== $previousKey) {
                $key = "{$previousKey}[{$key}]";
            }

            if (is_array($value)) {
                $queryParameters = $this->buildQueryString($value, $queryParameters, $key);
            } else {
                $queryParameters[] = "{$key}={$value}";
            }
        }

        return null !== $previousKey ? $queryParameters : implode('&', $queryParameters);
    }
865501
public static function fromDataQueryParams($params)
    {
        // Switch on reading mode
        if (empty($params["Versioned.mode"])) {
            return null;
        }

        switch ($params["Versioned.mode"]) {
            case 'archive':
                return 'Archive.' . $params['Versioned.date'] . '.' . $params['Versioned.stage'];
            case 'stage':
                return 'Stage.' . $params['Versioned.stage'];
            default:
                return null;
        }
    }
657974
public function execute($params = null)
    {
        $stmt = null;
        $attempt = 0;
        $retry = true;
        while ($retry) {
            $retry = false;
            try {
                $stmt = $this->stmt->execute($params);
            } catch (\Exception $e) {
                if ($this->conn->canTryAgain($attempt) && $this->conn->isRetryableException($e, $this->sql)) {
                    $this->conn->close();
                    $this->createStatement();
                    ++$attempt;
                    $retry = true;
                } else {
                    throw $e;
                }
            }
        }

        return $stmt;
    }
1312270
public function query($query, $params = array())
  {
    $curl = new Curl();
    $params['key'] = $this->server_key;
    $result = json_decode($curl->call(self::GOOGLEPLUS_API_URL . trim($query, '/') . '?' . http_build_query($params), array(), 'GET', true), true);
    if(!isset($result['error'])) {
      return $result;
    }
    return $this->debug_mode ? $result['error']['message'] : null;
  }
365198
function(param) {
			this.writeDebug('getQueryString',param);
			if(param) {
				param = param.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
				var regex = new RegExp('[\\?&]' + param + '=([^&#]*)'),
					results = regex.exec(location.search);
				return (results === null) ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
			}
		}