Let’s say I have an entity called Game which has a home_school_id. I can of course do $myGame->getHomeSchool()->getId() if I want that school’s id, but that takes up too much memory. How can I just directly get home_school_id?
Let’s say I have an entity called Game which has a home_school_id . I
Share
In your GameRepository.php. Then, do a $game->getHomeSchoolId($id);
You’ll just have to work with your select, from and where, but that’s really easy.
If you want the ID of another entity, which is linked through a relation, you’ll have to do a join. Just ask if you need more informations.