Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor all models with method to get Ids on relations #128

Open
troccoli opened this issue Jun 13, 2020 · 0 comments
Open

Refactor all models with method to get Ids on relations #128

troccoli opened this issue Jun 13, 2020 · 0 comments
Assignees
Labels
enhancement refactor unscheduled Issues that have not yet been put in a project

Comments

@troccoli
Copy link
Owner

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;

@troccoli troccoli added the unscheduled Issues that have not yet been put in a project label Jun 28, 2020
@troccoli troccoli self-assigned this Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement refactor unscheduled Issues that have not yet been put in a project
Projects
None yet
Development

No branches or pull requests

1 participant