but if I build the same class attributes manuelly (written in the class),
it all runs fine.
but when using __construct, __get/__set
I spend hours yesterday, turning the problem upside down, found some good post about it , but I still don’t understand ? if someone might have some insight on my error, or is it simpl-Yii ?
Thanks
function __construct($data){
foreach ($myClassList as $key) {
$this->$key = $data[$key];
}
parent::__construct();
}
public function __set($key, $value){$this->$key = $value;}
public function __get($value){ return $value;}
As mentioned above: You’ll need to override the init() method. Then, you will have to work on the _attributes property. That’s an associative array holding all model attributes as $key=>$value pairs.