yii\db\ActiveQueryInterface::via PHP Method

via() public method

Specifies the relation associated with the junction table for use in relational query.
public via ( string $relationName, callable $callable = null )
$relationName string the relation name. This refers to a relation declared in the [[ActiveRelationTrait::primaryModel|primaryModel]] of the relation.
$callable callable a PHP callback for customizing the relation associated with the junction table. Its signature should be `function($query)`, where `$query` is the query to be customized.
    public function via($relationName, callable $callable = null);