$criteria = new CDbCriteria; $criteria->addNotInCondition('id', array(1, 3, 5)); $users = User::model()->findAll($criteria);
$criteria = new CDbCriteria; $criteria->addNotInCondition('customer_id', array(10, 20, 30)); $criteria->compare('status', 'completed'); $orders = Order::model()->findAll($criteria);In both examples, the addNotInCondition method is used to add a filtering condition to the criteria object. The first argument is the name of the column and the second argument is an array of values that are not acceptable for that column. The package library used here is Yii framework.