Search with relational table

I’ve this scenario:

  • property table (list of buildings)

  • phonecall table (list of phone calls)

  • Relational table property_phonecall (someone mades a phone call asking for N properties)

I’m using a GridView to show phone calls. I want to filter this list and show phonecalls related to some properties, but when I add a joinWith method to PhoneCall find() to join with property_phonecall table I get this error:




app\models\PhoneCall has no relation named "property_phonecall".

Caused by: Unknown Method – yii\base\UnknownMethodException

Calling unknown method: app\models\PhoneCall::getproperty_phonecall()



I don’t know how to do this. Anyone can help me?

It works now. I used table name in joinWith method but you must use model relational property instead :lol: :lol: