Skip to content

Commit

Permalink
Merge pull request #12 from ixanov/master
Browse files Browse the repository at this point in the history
highlight doc
  • Loading branch information
boldtrn authored Aug 22, 2018
2 parents b2c53e9 + ae86102 commit 548aae5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $ composer require "boldtrn/jsonb-bundle:~1.1"
Step 2: Add the new Types and Functions to the Config
-------------------------

```
```yaml
# config.yml
doctrine:
dbal:
Expand All @@ -55,7 +55,7 @@ Note: There were people having issues with the above configuration. They had the
```

This was fixed by changing the dql part in the following (add the `entity_managers` between `orm` and `dql`):
```
```yaml
doctrine:
orm:
entity_managers:
Expand All @@ -65,7 +65,7 @@ doctrine:
Step 3: Create a Entity and Use the Jsonb Type
-------------------------
```
```php
/**
* @Entity
*/
Expand All @@ -92,7 +92,7 @@ class Test
Step 4.1: Write a Repository Method using a NativeQuery
-------------------------

```
```php
$q = $this
->entityManager
->createNativeQuery(
Expand All @@ -112,7 +112,7 @@ Step 4.2: Write a Repository Method that queries for the jsonb using the custom
This example shows how to use the contains statement in a WHERE clause.
The `= TRUE` is a workaround for Doctrine that needs an comparison operator in the WHERE clause.

```
```php
$q = $this
->entityManager
->createQuery(
Expand All @@ -125,7 +125,7 @@ $q = $this
```

This produces the following Query:
```
```SQL
SELECT t0_.id AS id0, t0_.attrs AS attrs1 FROM Test t0_ WHERE (t0_.attrs @> 'value') = true
```

Expand All @@ -138,7 +138,7 @@ The result could be data like:
```


```
```php
$q = $this
->entityManager
->createQuery(
Expand All @@ -151,7 +151,7 @@ The result could be data like:
```

This produces the following Query:
```
```SQL
SELECT t0_.id AS id0, t0_.attrs AS attrs1 FROM Test t0_ WHERE (t0_.attrs #>> '{\"object1\",\"object2\"}') LIKE '%a%'
```

Expand Down

0 comments on commit 548aae5

Please sign in to comment.