Hey community!
I have one table "Tickers" with the columns "team_home" and "team_guest" and another table "Teams" with "id" and "name". Now I want to get the teams without separately calling the teams-model.
So I think the code should look like the following
foreach (Tickers::findFirst() as $ticker) {
$teamHome = $ticker->teamHomeObj;
$teamGuest = $ticker->teamGuestObj;
}
And NOT:
foreach (Tickers::findFirst() as $ticker) {
$teamHome = Teams::findFirst("id=".$ticker->team_home);
$teamGuest = Teams::findFirst("id=".$ticker->team_guest);
}
greetings Eike