How to get SQL like this :
select * from foo where LOWER(foo_name) like '%test%';
I know that I can achieve this:
select * from foo where LOWER(foo_name) = 'test';
By:
$where->addPredicate(new Predicate\Expression('LOWER(foo_name) = ?', 'test' ));
And this:
select * from foo where foo_name like '%test%';
By:
$where->addPredicate( new \Zend\Db\Sql\Predicate\Like('LOWER(foo_name)', '%test%'));
But how to combine the two?
Answer given by @dave works fine.
Even this works -
$where->expression("LOWER(title) LIKE ?", '%test%');