ghaly
1
My query like :
SELECT * FROM items WHERE (name LIKE '%lorem%' OR desc LIKE '%lorem%' ) AND status = 1
which are name and desc are translationField
I mean in ItemsI18nTable table and status column in Item table.
so how can I build it in cakephp 4 ?
https://book.cakephp.org/4/en/orm/query-builder.html#advanced-conditions
Read about OR
at the beginning and try put there 2 like()
functions described in same chapter.
Hi @ghaly you can try this way :- $this->Items->find(‘all’,[‘conditions’=>[‘OR’=>[‘name LIKE’=>‘%lorem%’,‘desc LIKE’=>‘%lorm%’],‘status’=>1]])
It would be handle many ways bro… for more info you read Cakephp Docs at Once!