PHP code example of graviton / php-rql-parser

1. Go to this page and download the library: Download graviton/php-rql-parser library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

graviton / php-rql-parser example snippets




= 'or(eq(name,foo)&eq(name,bar))';

/** @var \Doctrine\ODM\MongoDB\Query\Builder $builder */
$visitor = new \Graviton\Rql\Visitor\MongoOdm();
$visitor->setBuilder($builder);
$lexer = new \Graviton\RqlParser\Lexer;
$parser = \Graviton\RqlParser\Parser::createDefault();

// parse some Resource Query Language 
$rqlQuery = $parser->parse($lexer->tokenize($rql));

// get query
$query = $visitor->visit($rqlQuery)->getQuery();

// ...
bash
composer