Hi mates,
Now I am trying to code a new site based on Yii 1.0.7
I have next tables in my DB:
‘Catalogue’
‘Country’
‘PressRelease’
So, in catalogue we can add a book title that is related to countries because I need to specify to witch country does the book title belongs to. After this I want to do a press release of an appropriate catalogue item (for a book). So, in ‘show’ view of the PressRelease we will have:
Catalogue item with all sufficient for the press release data, country, press release fields.
So, we have PressRelease relations :
'catalogueItem' => array(self::BELONGS_TO, 'Catalogue', 'IDCatalogueItem'),
Catalogue relations:
'country' => array(self::BELONGS_TO, 'Countries', 'countryCode'),
Loading a press release:
$this->_model=PressRelease::model()->with(array('catalogueItem', 'catalogueItem.country'=>array('select'=>'name')))->findbyPk($id!==null ? $id : $_GET['id']);
than we put this data to the press release ‘show’ view… But I can not retrieve $model->catalogueItem-><FIELD>
Any ideas?