We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Criteria Search OR operator

Its possible to Criteria generate a Condition with Or instead of AND

$data = Criteria::fromInput($this->getDI(), '\Apps\Models\Conteudos', $fields);

Generates

["conditions"]=> string(89) "titulo LIKE :titulo: AND sub_titulo LIKE :sub_titulo: AND conteudo_texto=:conteudo_texto:"



34.6k
Accepted
answer

It always uses AND, maybe you can create your own function based on the original one: https://github.com/phalcon/cphalcon/blob/2.0.x/phalcon/mvc/model/criteria.zep#L646

thanks I'll, maybe you can create an option to change it!!

thanks andres!