w tabeli ktorej rekord pobieram znajduja sie dwa klucze obce do pozostalych dwoch z ktorych potrzebuje pobrac pole title.
Robie tak:
Kod
$c = new Criteria();
$c->add(theaMenuItemPeer::MENU_ITEM_ID , $this->getRequestParameter('menu_item_id') );
$c->addJoin(theaMenuItemPeer::SYSTEM_ID , theaLinkPeer::SYSTEM_ID);
$c->addJoin(theaMenuItemPeer::MENU_ID , theaRegisteredMenuPeer::MENU_ID);
$this->thea_menu_item = theaMenuItemPeer::doSelect( $c );
$this->thea_menu_item = $this->thea_menu_item[0];
$c->add(theaMenuItemPeer::MENU_ITEM_ID , $this->getRequestParameter('menu_item_id') );
$c->addJoin(theaMenuItemPeer::SYSTEM_ID , theaLinkPeer::SYSTEM_ID);
$c->addJoin(theaMenuItemPeer::MENU_ID , theaRegisteredMenuPeer::MENU_ID);
$this->thea_menu_item = theaMenuItemPeer::doSelect( $c );
$this->thea_menu_item = $this->thea_menu_item[0];
w efekcie dostaje poprawne zapytanie, w wyniku ktorego powinno byc wszystko czego potrzebuje:
Cytat
SELECT thea_menu_item.MENU_ITEM_ID, thea_menu_item.SYSTEM_ID, thea_menu_item.MENU_ID, thea_menu_item.CREATED_AT FROM thea_menu_item, thea_link, thea_registered_menu WHERE thea_menu_item.MENU_ITEM_ID=1 AND thea_menu_item.SYSTEM_ID=thea_link.SYSTEM_ID AND thea_menu_item.MENU_ID=thea_registered_menu.MENU_ID
Mój cały problem polega na tym ze ni mam zielonego pojecia jak dobrac sie do tych danych

Próbowałem robic cos takiego:
Kod
$this->thea_menu_item->getTheaLink()->getTitle();
Ale to kłóci się trochę z tym co napisałem wcześniej ponieważ dochodzi kolejne niepotrzebne zapytanie do bazy:
Cytat
SELECT thea_link.SYSTEM_ID, thea_link.MODULE_ID, thea_link.MODULE_ITEM_ID, thea_link.TITLE, thea_link.POSITION, thea_link.LINK_TYPE, thea_link.EXPAND, thea_link.CREATED_AT FROM thea_link WHERE thea_link.SYSTEM_ID=1
Bardzo proszę Was o pomoc, ponieważ na pewno jest jakiś optymalny sposób aby pobrać dane z trzech tabel w jednym zapytaniu.
Pozdrawiam