Hello
I have an object inside my model (CActiveRecord), I have to initialize this object with a property from the database. To do that I use the init() method but the property is null
here the code
class CompanyFidelityCard extends CActiveRecord
{
public $Privacy;
public function init()
{
$this->Privacy=new PrivacyCode($this->privacy_code);
parent::init();
}
.........
$this->privacy_code is null coz if I change it for this
$this->Privacy=new PrivacyCode(‘1111111111111111111111111111111111111111’);
works
I have tried as well with afterConstruct() method by the result is the same.
any help? thanks in advance
PD; sorry if I have done a mistake is my first post, I have read the guidline and search about this here…
PPD;sorry for my english too