How would I write a query such as:
SELECT id FROM Records WHERE name = BINARY 'My Record';
Using Doctrine Query Builder? 'My Record'
could be any arbitrary name to query for.
The following does not work... Honestly, I didn't expect this to work but I can't think of anything else to try.
// Assume $repo is the Records repository
// Assume $name is the name to query, such as "My Record"
$repo->createQueryBuilder('r')
->select('r.id')
->where('r.name = BINARY :name')
->setParameter('name', $name)
->getQuery()
->getResult();
source https://stackoverflow.com/questions/69759179/doctrine-query-builder-dql-how-to-write-query-with-where-column-binary-te
Comments
Post a Comment