If I have a competition and I want to get its season's id I need to do
$competition->getSeason()->getId();
But that queries the database to get the Season model, which is unnecessary, as the Competition model already has the season's id. I should be able to do
$competition->getSeasonId();
which under the hood returns $competition->season_id;
If I have a competition and I want to get its season's id I need to do
But that queries the database to get the Season model, which is unnecessary, as the Competition model already has the season's id. I should be able to do
which under the hood returns
$competition->season_id
;