Symfony2 and Doctrine: how to use capital-sensitive findOneBy method

Using Symfony2, Doctrine, and MySQL, I use the findOneBy method.

I need him to take capital into account when talking about string criteria.

Example: Imagine that I have this path field in some table in my database.

 id path --------- 1 path1 2 path2 3 path3 4 path4 

If I do findOneByPath("PATH2") , it will find the second line.

Question: how can I do this to distinguish capitals so that it does not find a single line in the described case?

0
source share
1 answer

The problem is not the doctrine / symfony question - the problem is that table matching is not case sensitive (this is the default), if you want search queries to be case sensitive, you need to use a different sort for your tables.

+2
source

Source: https://habr.com/ru/post/1203221/


All Articles