Alias of ping.

@param type $query

@return type
771507
public static function exists($query)
    {
        //
        static::applySchema();

        //
        $table = self::getTable();

        //
        $whereArray = [];

        //
        $valuesArray = [];

        //
        if (isset($query['where'])) {
            $whereArray[] = $query['where'];
            unset($query['where']);
        }

        //
        $schema = static::getSchemaFields();

        //
        foreach ($schema as $field) {
            if (isset($query[$field])) {
                $token = ':'.$field;
                $whereArray[] = "`{$field}` = {$token}";
                $valuesArray[$token] = $query[$field];
            }
        }

        $where = count($whereArray) > 0
               ? 'WHERE '.implode(' AND ', $whereArray)
               : '';

        $sql = "SELECT * FROM `{$table}` {$where} LIMIT 1";

        $row = static::getDatabase()->getRow($sql, $valuesArray);

        return $row ? self::create($row) : false;
    }
903932
private function runQuery($query)
    {
        $resultSetMapping = (new ResultSetMapping())
                ->addScalarResult('id', 'id')
                ->addScalarResult('type', 'type')
                ->addScalarResult('date', 'date');
        
        return $this->em->createNativeQuery($query, $resultSetMapping)
                ->getArrayResult();
    }
200678
public function determineSubType($query)
    {
        /**
         * First we get rid of all PREFIX information.
         */
        $adaptedQuery = preg_replace('/PREFIX\s+[a-z0-9]+\:\s*\<[a-z0-9\:\/\.\#\-]+\>/', '', $query);

        // remove trailing whitespaces
        $adaptedQuery = trim($adaptedQuery);

        // only lower chars
        $adaptedQuery = strtolower($adaptedQuery);

        $firstPart = substr($adaptedQuery, 0, 8);

        switch ($firstPart) {
            // CLEAR GRAPH
            case 'clear gr':
                return 'clearGraph';

            // CREATE GRAPH
            case 'create g':
                return 'createGraph';

            // CREATE SILENT GRAPH
            case 'create s':
                return 'createSilentGraph';

            // DROP GRAPH
            case 'drop gra':
                return 'dropGraph';

            // DROP SILENT GRAPH
            case 'drop sil':
                return 'dropSilentGraph';

            default:
                return null;
        }
    }
322539
protected function queryGetThisTable($query)
	{
		if ($this->table_alias) {
			return $query->quoteIdent($this->table).' AS '.$query->quoteIdent($this->table_alias);
		} else {
			return $query->quoteIdent($this->table);
		}
	}
846828
public function columnSelect(self $query, ?string $alias = null)
    {
        if ($alias) {
            $alias = $this->dialect()->quoteName($alias);
        }

        $this->addColumn($query, $alias);

        return $this;
    }
1334224
public final function withQuery($query): UriInterface
   {
       if (!is_string($query)) {
           throw new InvalidArgumentException(
               "Can't get with query: invalid query string");
       }
       return $this->with("query", $this->parseQuery($query));
   }
209310
private function getCacheKey(Query $query): string
    {
        if (null !== $this->precision && $query instanceof ReverseQuery) {
            $query = $query->withCoordinates(new Coordinates(
                number_format($query->getCoordinates()->getLatitude(), $this->precision),
                number_format($query->getCoordinates()->getLongitude(), $this->precision)
            ));
        }

        // Include the major version number of the geocoder to avoid issues unserializing.
        return 'v4'.sha1((string) $query);
    }
379862
public function defineSearch($query, $type)
    {
        $query = Util::escapeTerm($query);

        $elasticaQueryString = new Match();
        $elasticaQueryString
            ->setFieldMinimumShouldMatch('content', '80%')
            ->setFieldQuery('content', $query);

        if ($this->useMatchQueryForTitle) {
            $elasticaQueryTitle = new Match();
            $elasticaQueryTitle
              ->setFieldQuery('title', $query)
              ->setFieldMinimumShouldMatch('title', '80%')
              ->setFieldBoost(2);
        } else {
            $elasticaQueryTitle = new QueryString();
            $elasticaQueryTitle
              ->setDefaultField('title')
              ->setQuery($query);
        }

        $elasticaQueryBool = new BoolQuery();
        $elasticaQueryBool
            ->addShould($elasticaQueryTitle)
            ->addShould($elasticaQueryString)
            ->setMinimumShouldMatch(1);

        $this->applySecurityFilter($elasticaQueryBool);

        if (!is_null($type)) {
            $elasticaQueryType = new Term();
            $elasticaQueryType->setTerm('type', $type);
            $elasticaQueryBool->addMust($elasticaQueryType);
        }

        $rootNode = $this->domainConfiguration->getRootNode();
        if (!is_null($rootNode)) {
            $elasticaQueryRoot = new Term();
            $elasticaQueryRoot->setTerm('root_id', $rootNode->getId());
            $elasticaQueryBool->addMust($elasticaQueryRoot);
        }

        $rescore = new \Elastica\Rescore\Query();
        $rescore->setRescoreQuery($this->getPageBoosts());

        $this->query->setQuery($elasticaQueryBool);
        $this->query->setRescore($rescore);
        $this->query->setHighlight(
            array(
                'pre_tags' => array('<strong>'),
                'post_tags' => array('</strong>'),
                'fields' => array(
                    'content' => array(
                        'fragment_size' => 150,
                        'number_of_fragments' => 3,
                    ),
                ),
            )
        );
    }
290178
public function executeQuery($query = null)
    {
        $connection = $this->getConnection();
        
        $connection->transaction(function (ConnectionInterface $connection) use ($query) {
            $connection->execute($query);
        });
        
        return $connection->affectedRows();
    }
880987
public static function fix_cat_wp_quirk( $query ) {
		if ( isset($query->query) && isset($query->query['category'])
				&& !isset($query->query['cat']) ) {
			$query->set('cat', $query->query['category']);
			unset($query->query['category']);
		}
		return $query;
	}
14814
private function filterQuery(string $query): string
    {
        if ($query !== '' && $query[0] === '?') {
            $query = \substr($query, 1);
        }

        $parts = \explode('&', $query);
        foreach ($parts as $index => $part) {
            [$key, $value] = $this->splitQueryValue($part);
            if ($value === null) {
                $parts[$index] = $this->filterQueryOrFragment($key);
                continue;
            }

            $parts[$index] = $this->filterQueryOrFragment($key) . '=' . $this->filterQueryOrFragment($value);
        }

        return implode('&', $parts);
    }
795417
protected function _selectQueryTranslator($query)
    {
        $limit = $query->clause('limit');
        $offset = $query->clause('offset');

        if ($limit && $offset === null) {
            $query->modifier(['_auto_top_' => sprintf('TOP %d', $limit)]);
        }

        if ($offset !== null && !$query->clause('order')) {
            $query->order($query->newExpr()->add('(SELECT NULL)'));
        }

        if ($this->_version() < 11 && $offset !== null) {
            return $this->_pagingSubquery($query, $limit, $offset);
        }

        return $this->_transformDistinct($query);
    }
873648
public function query($query = NULL) {
        if (isset($query)) {
            $this->setQuery(self::cleanQuery($query));
            return $this;
        }
        return $this->getQuery();
    }
1200230
public function findRaw($query) {
        $this->_type = self::QUERY_RAW;
        $this->_query = $query;

        return $this;
    }
739073
private function postType(\WP_Query $query)
    {
        $type = $query->get('post_type');
        is_array($type) and $type = reset($type);

        $object = get_post_type_object($type);
        (is_object($object) && $object->has_archive) or $type = '';

        return $type;
    }
128446
public function withQuery(string $query): UriInterface
    {
        $query = $this->marshalQueryAndFragment($query);

        if ( $this->query === $query ) {
            return $this;
        }

        $instance = clone $this;
        $instance->query = $query;

        return $instance;
    }
1016875
public function orderBy($query = [])
    {
        if (!empty($query))
        {
            $i = 0;

            foreach ($query as $key => $value) {
                $tableName = '';
                $orderBy   = $this->getOrderBy();

                if (strpos($key, '.') === false) {
                    $tableName = $this->table() . '.';
                }

                if ($i>0) {
                    $orderBy .= ', ' . $tableName . $key . ' ' . $value;
                } else {
                    $orderBy .= ' ORDER BY ' . $tableName . $key . ' ' . $value;
                }

                $this->setOrderBy($orderBy);
                $i++;
            }
        }

        return $this;
    }