propelorm/Propel

Filter records by wildcard

glominashvili opened this issue · 4 comments

I have code $customersQuery->filterByFirstname('%'.$firstName.'%');.
After reading this page http://propelorm.org/Propel/reference/model-criteria.html i found out that propel uses LIKE keyword when wildcard is present in argument. But this code is not working.
On http://propelorm.org/documentation/reference/model-criteria.html there is ->where method but i don't want to harcode sql in my code. Can someone help me?

I have found it. You need to pass Criteria::LIKE as second argument.

@svireli you can also use * then your constraint should automatically be Criteria::LIKE

This does not tell other people anything. The links are not working. Please provide working examples so when this is the top google search it is actually useful for future people searching similar issues.

Sorry, it was my mistake. Links are working now.