Mam następujący schemat bazy z dwiema tabelami:
Team: actAs: Timestampable: ~ columns: name: type: varchar(100) notnull: true Meet: actAs: Timestampable: ~ columns: team1_id: type: integer notnull: true team2_id: type: integer notnull: true relations: Team1: class: Team local: team1_id foreign: id Team2: class: Team local: team2_id foreign: id
Jak widać Tabela MEET zawiera dwa pola z ID pochodzące z tabeli TEAM. Dzięki temu MEET (SPOTKANIE) to połącznie dwóch TEAM (DRUŻYN).
I teraz tak:
w Kontrolerze action.class.php w metodzie executeIndex() mam tak:
$this->meets = MeetTable::getInstance()->findAll();
Natomiast w Widoku indexSuccess.php mam tak:
<?php foreach ($meets as $meet):?> <br /> <?php endforeach;?>
Nie wiem jednak jak wyświetlić nazwy drużyn zamiast ID
proszę o podpowiedź,
dzięki