0

With PHP, how do we query a relationship of a relationship using Active Record?

We are not directly querying the relation (venue) with the relationship (city).

I've tried

$model = $model->relatedTo($searchParam['city']);

and...

$model = $model->relatedTo([
                    'targetElement' => 'venue',
                    'field'         => 'city'
                ]);

and...

 $model = $model->section('venues')->relatedTo($searchParam['city']);

But nothing.

Cheers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.