viaTable() public method
Specifies the junction table for a relational query. Use this method to specify a junction table when declaring a relation in the yii\db\ActiveRecord class: public function getItems()
{
return $this->hasMany(Item::className(), ['id' => 'item_id'])
->viaTable('order_item', ['order_id' => 'id']);
}
See also via().
public $this viaTable ( $tableName, $link, callable $callable = null )$tableName string
The name of the junction table.