GDS\Gateway\ProtoBuf::gql PHP Méthode

gql() public méthode

In local dev environments, we may convert the GQL query later.
public gql ( string $str_gql, array | null $arr_params = null ) : Entity[] | null
$str_gql string
$arr_params array | null
Résultat GDS\Entity[] | null
    public function gql($str_gql, $arr_params = null)
    {
        $obj_query_request = $this->setupRunQuery();
        $obj_gql_query = $obj_query_request->mutableGqlQuery();
        $obj_gql_query->setQueryString($str_gql);
        $obj_gql_query->setAllowLiteral(TRUE);
        if (null !== $arr_params) {
            $this->addParamsToQuery($obj_gql_query, $arr_params);
        }
        $obj_gql_response = $this->execute('RunQuery', $obj_query_request, new RunQueryResponse());
        $arr_mapped_results = $this->createMapper()->mapFromResults($obj_gql_response->getBatch()->getEntityResultList());
        $this->obj_schema = null;
        // Consume Schema
        return $arr_mapped_results;
    }