I\'m trying to learn Symfony. Today I was following The associations tutorial. I decided to make a small application that a House, Kitchens, Bedrooms, and cabinets. I (tried to
In your debug bar in symfony you should probably be seeing some errors in doctrine. These won't show up in PHPStorm. You need to rename $kitchen and $bedroom to their plural forms $kitchens and $bedrooms (and change your getters/setters to match) since this is how you define things in the owning side of your doctrine relationships.
A simpler approach than your repository method would be to do what you want in your controller to let doctrine do your heavy lifting:
$cabinets = [];
$house = $bedroom->getHouse();
$kitchens = $house->getKitchens();
foreach ($kitchens as $kitchen) {
$kitchenCabinets = $kitchen->getCabinets();
$cabinets = array_merge($cabinets, $kitchenCabinets);
}