<commit_before># breeze.server.php (Doctrine 2)

<!--
(Inspired by [breeze.server.java](https://github.com/Breeze/breeze.server.java))
-->

This project is a PHP library that facilitates building [Breeze](http://www.breezejs.com/)-compatible backends using
[Doctrine](http://hibernate.org/orm/).

### Features:

- Generates [Breeze metadata](http://www.breezejs.com/documentation/metadata) from Doctrine mappings
- Parses (a subset of) [OData](http://www.odata.org/documentation/odata-version-3-0/url-conventions/) queries into [QueryBuilder](http://docs.doctrine-project.org/en/2.0.x/reference/query-builder.html) instance
- Executes queries using Doctrine Entity Manager
- Expands graphs of related entites using EAGER loading with joins
- Serializes query results to [JSON](http://www.json.org/) with [JMSSerializer](http://jmsyst.com/libs/serializer)
- Handles saving Breeze payloads in Doctrine

TODO: add examples

## Usage


### Basic Usage

using composer
<commit_msg>add supported odata query options<commit_after># breeze.server.php (Doctrine 2)

<!--
(Inspired by [breeze.server.java](https://github.com/Breeze/breeze.server.java))
-->

This project is a PHP library that facilitates building [Breeze](http://www.breezejs.com/)-compatible backends using
[Doctrine](http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/).

### Features:

- Generates [Breeze metadata](http://www.breezejs.com/documentation/metadata) from Doctrine mappings
- Parses (a subset of) [OData](http://www.odata.org/documentation/odata-version-3-0/url-conventions/) queries into [QueryBuilder](http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/query-builder.html) instance
- Executes queries using Doctrine Entity Manager
- Expands graphs of related entites using EAGER loading with joins
- Serializes query results to [JSON](http://www.json.org/) with [JMSSerializer](http://jmsyst.com/libs/serializer)
- Handles saving Breeze payloads in Doctrine

#### OData Grammar

Currently, only a subset of the [OData protocol specification](http://www.odata.org/documentation/odata-version-3-0/odata-version-3-0-core-protocol/) is handled.

- **$orderby**: supported
- **$top**: supported
- **$skip**: supported
- **$inlinecount**: supported
- **$select**: supported
- **$format**: not supported, always returns JSON
- **$links**: not supported
- **$count**: not supported
- **$filter**: 
    - All Logical Operators supported (eq, ne, gt, ge, lt, le, and, or, not)
    - Arithmetic Operators NOT supported (add, sub, mul, div, mod)
    - Grouping supported (e.g: $filter=(Price sub 5) gt 10)
    - All String Functions supported, except `replace`
   


TODO: add examples

## Usage


### Basic Usage

using composer

{'fraction_non_alphanumeric': 0.1475649945075064, 'fraction_numerical': 0.005492493592090809, 'mean_word_length': 4.598360655737705, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 9, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '34401', 'n_tokens_mistral': 891, 'n_tokens_neox': 851, 'n_words': 222}