Relation joined by 1 column or another column

How can I do a relation that is joined by one column or another column?

I want to do this as a method in my model similar to the way normal relations are done.

James.

Use yii’s active record relations (in the manual), then do something like




Booking::find()->where('item.value > :something')->innerJoinWith('item')