Skip to content

Parses and applies RQL scripts to doctrine query builders

License

Notifications You must be signed in to change notification settings

bilal-renegade/doctrine-rql

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

doctrine-rql

Parses and applies RQL/FIQL scripts to doctrine orm query builders.

Installation

composer require andreas-glaser/doctrine-rql 0.4.*

Usage Test

<?php

require 'vendor/autoload.php';

use AndreasGlaser\DoctrineRql\Factory\ORMVisitorFactory;

$rqlString = $_GET['rql']; // ?rql=and(eq(cart.id,123),eq(cart.archived,0))

/** @var QueryBuilder $qb */
$qb = $entityManager->createQueryBuilder();

$qb
    ->select('cart')
    ->from('TestApp\Entity\Cart', 'cart');

// append filters
ORMVisitorFactory::appendFiltersOnly($queryBuilder, $rqlString, false);

/** @var TestApp\Entity\Cart[] $cartEntities */
$cartEntities = $qb
    ->getQuery()
    ->execute();

A full list of available RQL/FIQL operators can be found at:

https://github.com/libgraviton/rql-parser/#operators

Additional Operators

  • NULL Comparison
    • isnull(fieldName)
    • isnotnull(fieldName)

About

Parses and applies RQL scripts to doctrine query builders

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 99.6%
  • Shell 0.4%