From official guide Docs
class Customer extends \yii\db\ActiveRecord
{
public function getBigOrders($threshold = 100)
{
return $this->hasMany(Order::className(), ['customer_id' => 'id'])
->where('subtotal > :threshold', [':threshold' => $threshold])
->orderBy('id');
}
}
How can I achieve the following:
$customers = Customer::find()
->with('bigOrders') //here I need to provide $threshold somehow
->all();