Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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:"



33.7k
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!