The following code shows how to apply a default condition for all queries:
Код: Выделить всё
class Customer extends ActiveRecord
{
public static function find()
{
return parent::find()->where(['deleted' => false]);
}
}
// Use andWhere()/orWhere() to apply the default condition
// SELECT FROM customer WHERE `deleted`=:deleted AND age>30
$customers = Customer::find()->andWhere('age>30')->all();
// Use where() to ignore the default condition
// SELECT FROM customer WHERE age>30
$customers = Customer::find()->where('age>30')->all();
во всех остальных примерах в качестве параметра для where всегда передается массив - и это работает.Where condition must be an array in redis ActiveRecord.
Код: Выделить всё
$customers = Customer::find()->where(['age' => 30])->all();
Собственно вопрос - поддерживает ли фреймворковский ActiveRecord для Redis операции сравнения и желательно маленький примерчик.