Parse JSON coming from jQuery QueryBuilder, such as
{
"condition": "AND",
"rules": [
{
"id": "price",
"field": "price",
"type": "double",
"input": "text",
"operator": "less",
"value": "10.25"
}
]
}
$ composer require fourlabs/qbjs-parser
FL\QBJSParser\Serializer\JsonDeserializer::deserialize()
deserializes a JSON string into an instance ofFL\QBJSParser\Model\RuleGroup
- This
RuleGroup
object can then be parsed into something your ORM/ODM can use, to create a query. - Parsers live at
FL\QBJSParser\Parser
.
To run the test suite, you need composer.
$ composer install
$ phpunit
QBJSParser is licensed under the MIT license.