Skip to content

Instantly share code, notes, and snippets.

@stephpy
Created June 25, 2013 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephpy/5859442 to your computer and use it in GitHub Desktop.
Save stephpy/5859442 to your computer and use it in GitHub Desktop.
$rb = new \Hoa\Ruler\RuleBuilder();
$rb->or(
$rb->and(
$rb->equals($rb->context('foo'), 100),
$rb->notEquals($rb->context('baz'), 150),
$rb->not($rb->context('bar'))
),
$rb->in($rb->scalar('toto'), $rb->context('users'))
);
//'(foo = 100 AND baz != 150 AND NOT(bar)) OR "toto" IN users'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment