Created
December 29, 2020 00:02
-
-
Save grizmio/607300a94f99ec99dcdfb0ebd4c5e423 to your computer and use it in GitHub Desktop.
Symfony Doctrine jsonb columns postgresql operators with escape ? character since php 7.4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $v = "foobar.baz"; | |
| $rsm = new \Doctrine\ORM\Query\ResultSetMappingBuilder($this->_em); | |
| $rsm->addRootEntityFromClassMetadata(Bazar::class, 't_alias'); | |
| $query = $this->_em->createNativeQuery("select * from t td where t.foo ??| :v order by id asc", $rsm); | |
| $query->setParameter("v", $v); | |
| $v = ["asd", "qwert"]; | |
| $v_s = '{"'.implode('","', $v).'"}'; | |
| $query = $this->_em->createNativeQuery("select * from t where t.x ?? ? order by id asc", $rsm); | |
| $query->setParameter(1, $v_s); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment