src/Form/Type/AbstractInfluxChoiceType.php
final protected function loadChoicesFromQuery(string $query, string $columnName, string $connectionName = null)
    {
        $connection = $connectionName
            ? $this->connectionRegistry->getHttpConnection($connectionName)
            : $this->connectionRegistry->getDefaultHttpConnection()
        ;
        $measurements = array_map(function ($point) use ($columnName) {
            return $point[$columnName];
        }, $connection->query($query)->getPoints());

        return array_combine(array_values($measurements), $measurements);
    }
final protected function loadChoicesFromQuery(string $query, string $columnName, string $connectionName = null)
    {
        $connection = $connectionName
            ? $this->connectionRegistry->getHttpConnection($connectionName)
            : $this->connectionRegistry->getDefaultHttpConnection()
        ;
        $measurements = array_map(function ($point) use ($columnName) {
            return $point[$columnName];
        }, $connection->query($query)->getPoints());

        return array_combine(array_values($measurements), $measurements);
    }
final protected function loadChoicesFromQuery ( string $ query , string $ columnName , string $ connectionName = null ) { $ connection = $ connectionName ? $ this -> connectionRegistry -> getHttpConnection ( $ connectionName ) : $ this -> connectionRegistry -> getDefaultHttpConnection ( ) ; $ measurements = array_map ( function ( $ point ) use ( $ columnName ) { return $ point [ $ columnName ] ; } , $ connection -> query ( $ query ) -> getPoints ( ) ) ; return array_combine ( array_values ( $ measurements ) , $ measurements ) ; }
Executes the given query and converts the result to a proper choices list.

@param string      $query
@param string      $columnName
@param string|null $connectionName

@return array
Executes the given query and converts the result to a proper choices list .