how can i get a set of data, based on condition in relation table?
In Yii 1 i could use with() and 'on' statement. This doesn't work in Yii 2, or i can't find any good example.
For example in Yii 1 i could write this:
$criteria = new CDbCriteria();
$criteria->with = array('works'=>array('on' => 'works.user_id=t.id AND (works.work_id=$SOMEVALUE OR ...)'));
I tried something like this (userRight is my relation):
Foo::find()->with(['userRight'=>['on'=>['user_r'=>$this->id]]]);
Is there any solution in Yii 2?