« Back to overview

Find multiple entries not having a field value

$query = Entry::find()
                ->andWhere(new \yii\db\conditions\InCondition('field_fieldValues', 'NOT IN', $someFieldValues))
				// note: empty field values are ignored
;

Use parameter binding

Repeat the ':' in the parameter (unlike doctrine)


->andWhere('field_myName=:name', [':name' => $auctionUid])