Load blacklisted products for the given query.

@param Query|int $query Query.

@return array
163098
public function getProductBlacklistByQuery($query)
    {
        if (is_object($query)) {
            $query = $query->getId();
        }

        $select = $this->getBaseSelect()
            ->columns(['product_id'])
            ->where('query_id = ?', (int) $query)
            ->where('is_blacklisted = ?', (int) true);

        return $this->getConnection()->fetchCol($select);
    }
464698
public function search($query) {
        $found = false;
        if (strpos(strtolower($this->name), $query) !== false) {
            $found = true;
        } else if (strpos(core_text::strtolower($this->visiblename), $query) !== false) {
                $found = true;
            }
        if ($found) {
            $result = new stdClass();
            $result->page     = $this;
            $result->settings = array();
            return array($this->name => $result);
        } else {
            return array();
        }
    }
150443
public function getAllAsArray($query = null)
    {
        return [
            'unchangedCount' => $this->getUnchangedCount($query),
            'changedCount' => $this->getChangedCount($query),
            'failedCount' => $this->getFailedCount($query),
            'nodesCount' => $this->getNodesCount($query),
            'nodesCountByOS' => $this->getNodesCountByOS($query),
            'nodesPercentageByOS' => $this->getNodesPercentageByOS($query),
            'osCount' => $this->getOSCount($query),
            'recentlyRebootedNodes' => $this->getRecentlyRebootedNodes($query),
        ];
    }
257029
public function getTables(string &$query) : array
    {
        $tables = [];
        foreach ($this->tables as &$table) {
            if (strpos($query, $table['table_name']) !== false) {
                $tables[] = $table['table_name'];
            }
        }

        unset($table);
        return $tables;
    }
330768
function queryColumn($query)
  {
    $data = [];
    $res = $this->q($query);
    while ($row = $res->fetch_row())
    {
      if ($res->field_count == 1)
        $data[] = $row[0];
      else
        $data[$row[0]] = $row[1];
    }
    $res->close();
    return $data;
  }
884067
protected function parseSub($query)
    {
        if ($query instanceof self || $query instanceof EloquentBuilder) {
            return [$query->toSql(), $query->getBindings()];
        } elseif (is_string($query)) {
            return [$query, []];
        } else {
            throw new InvalidArgumentException;
        }
    }
1208201
public static function getList($query)
    {
        $ret = array();

        $res = self::query($query);
        if ($res) {
            while ($row = self::connection()->sql_fetch_row($res)) {
                $ret[$row[0]] = $row[1];
            }
            self::free($res);
        }

        return $ret;
    }
631512
public function actionAutoComplete($query)
    {
        Yii::$app->response->format = Response::FORMAT_JSON;
        $rows = Category::find()->select(['id', 'name'])->where(['like', 'name', $query])->asArray()->all();
        return $rows;
    }
1324620
protected function loadBlacklist()
    {
        // Check if caching is enabled
        if ($this->getConfig('cache.enabled', false) === false) {
            return $this->blackListRegex = $this->createRegex();
        }

        // Get Black list items
        return $this->blackListRegex = $this->cache->rememberForever($this->getCacheKey(), function () {
            return $this->createRegex();
        });
    }
340563
public function getSuggestionsForAutoComplete($query)
    {
        $models = $this->repository->findByFilter( array( 'name' => $query ) );

        return $this->convertToAutoComplete( $models );
    }
1306863
protected function rawQuery($query)
	{
		$start = microtime(TRUE);
		$res   = mysqli_query($this->conn, $query);
		$timer = microtime(TRUE) - $start;

		$this->stats[] = array(
			'query' => $query,
			'start' => $start,
			'timer' => $timer,
		);
		if (!$res)
		{
			$error = mysqli_error($this->conn);
			
			end($this->stats);
			$key = key($this->stats);
			$this->stats[$key]['error'] = $error;
			$this->cutStats();
			
			$this->error("$error. Full query: [$query]");
		}
		$this->cutStats();
		return $res;
	}
223388
public static function executeRow1(string $query): array
  {
    self::logQuery($query);

    return self::$dl->executeRow1($query);
  }
425137
public function allArray(Query $query = null) {
		$iterator = $this->getIterator();
		$array = $iterator->all($query);
		$array = $this->forgeEntity($array);
		return $array;
	}
538607
public function prepareExecuteAndFetchAll(Query $query)
    {
        $prepare = $this->prepareQuery($query);
        $execute = $this->executePrepared($prepare);

        return $this->fetchAllPrepared($prepare);
    }
1170364
public function searchByQuery($query) {
		$results = $this->ldap->search($this->basedn, $query);
		return $results;
	}
710770
public function getResourceGroups(Query $query = null) {
        if (!$query) {
            $query = new Query();
        }

        return $this->getCommand('GetResourceGroups', array(
            'page' => $query->page(),
            'limit' => $query->limit(),
        ))->execute();
    }
939329
protected function _filterQuery($query)
    {
        if (! empty($query) && strpos($query, '?') === 0) {
            $query = substr($query, 1);
        }

        $parts = explode('&', $query);
        foreach ($parts as $index => $part) {
            list($key, $value) = $this->_splitQueryValue($part);
            if ($value === null) {
                $parts[$index] = $this->_filterQueryOrFragment($key);
                continue;
            }
            $parts[$index] = sprintf(
                '%s=%s',
                $this->_filterQueryOrFragment($key),
                $this->_filterQueryOrFragment($value)
            );
        }

        return implode('&', $parts);
    }