Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fourlabsldn/qbjsparser
Parse JSON coming from jQuery QueryBuilder into database queries.
https://github.com/fourlabsldn/qbjsparser
Last synced: 5 days ago
JSON representation
Parse JSON coming from jQuery QueryBuilder into database queries.
- Host: GitHub
- URL: https://github.com/fourlabsldn/qbjsparser
- Owner: fourlabsldn
- License: mit
- Created: 2016-09-21T10:01:51.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-06-30T15:11:58.000Z (over 3 years ago)
- Last Synced: 2024-04-26T01:42:18.782Z (7 months ago)
- Language: PHP
- Homepage:
- Size: 129 KB
- Stars: 24
- Watchers: 4
- Forks: 16
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Query Builder JS Parser
[![StyleCI](https://styleci.io/repos/68804319/shield?branch=master)](https://styleci.io/repos/68804319)
[![Build Status](https://travis-ci.org/fourlabsldn/QBJSParser.svg?branch=master)](https://travis-ci.org/fourlabsldn/QBJSParser)
[![Coverage Status](https://coveralls.io/repos/github/fourlabsldn/QBJSParser/badge.svg?branch=master)](https://coveralls.io/github/fourlabsldn/QBJSParser?branch=master)
[![License](https://poser.pugx.org/fourlabs/qbjs-parser/license)](https://packagist.org/packages/fourlabs/qbjs-parser)
[![Total Downloads](https://poser.pugx.org/fourlabs/qbjs-parser/downloads)](https://packagist.org/packages/fourlabs/qbjs-parser)Parse JSON coming from [jQuery QueryBuilder](http://querybuilder.js.org/), such as
```json
{
"condition": "AND",
"rules": [
{
"id": "price",
"field": "price",
"type": "double",
"input": "text",
"operator": "less",
"value": "10.25"
}
]
}
```## Installation
```bash
$ composer require fourlabs/qbjs-parser
```## Quick Tour
- `FL\QBJSParser\Serializer\JsonDeserializer::deserialize()` deserializes a JSON string into an instance of `FL\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`.## Available Parsers
- [**Doctrine Parser**](Documentation/Parsers/Doctrine.md)## Tests
To run the test suite, you need [composer](http://getcomposer.org).
```bash
$ composer install
$ phpunit
```## License
QBJSParser is licensed under the MIT license.