Symfony + Doctrine Many to Many relations with Linking Tables

Situation:I have 3 tables: Student, Address, StudentAddressLink As follows Note* not EXACT yaml file but you get the idea\[code\]Student: column: id: blah blah name: blah blah Address: column: id: ~ street: ~ StudentAddressLink: column: id:~ student_id: ~ address_id: ~ relations: Student: local: student_id foreign: id Address: local: address_id foreign: id \[/code\]From the Student object I want to get the related "Address Street" currently I have to do this:\[code\]foreach($student->StudentAddressLink as $address){ echo $address->getStreet();}\[/code\]This works...but I though there was a way to do something that makes the link table transparent, something magical like this:\[code\]foreach($student->Addresss as $address){ echo $address->getStreet();}\[/code\]Any direction would be great!
 
Back
Top