I have a table "parkinggarages" with a foreign key "location_id". I also have a table "locations".
Table parkinggarages:
- id
- phone
- defaultlanguage
- capacity
- floors
- parkingtypeTable locations:
- id
- location
- lat
- lon
Now I want to select all the parkinggarages but I also want to select the "location" field from table "locations" with it.
How can I do this? I've tried this, but didn't work:
$result = ParkinggarageQuery::create()->joinWith('Location.location')
$parkinggarages = ParkinggarageQuery::create()
->leftJoinWith('Parkinggarage.Location')
->find();