How do you use lazy loading correctly in Yii? I have two models, Company and Settings. The relationship is defined at Company side with:
'settings' => array(self::HAS_ONE, 'Company', 'settingsId'),
and at Settings side with:
'company' => array(self::BELONGS_TO, 'Company', 'settingsId'),
Now, why does this not work in the Company model:
$settings = $this->settings;
echo $settings->someSetting;
The error is
Property "Company.someSetting" is not defined.