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

Nested IN condition with QueryBuilder

Is there any solution to solve the listed problem below?

Or the andWhere/orWhere function just accept a single conditions(equality test)?

If yes, is there any solution for change Phalcon ORM layer to for example Doctrine?

$qb = new \Phalcon\Mvc\Model\Query\Builder();

$this->qb->where("official_name LIKE :officialName:", ['officialName' => '%test%']);

$this->qb->andWhere('release.id IN :release_id: OR state = :state:',

['release_id' => [10, 11, 20], 'state' => 'test']);

PHP version: 5.5.12

Phalcon version: 2.0.8

Thank you for your help!



85.5k

PDO doesnt support array params ( as far as I remember ).

how I use in:

\Models\Model::query()
            ->inWhere(
                'brand_id', $brand_ids
            )
            ->columns('id, name, brand_id')
            ->execute()->toArray();