php - Model attributes set in beforeSave() are not being saved -
i trying set model attributes in beforesave() method not saved afterwards.
public function beforesave(){ if(!$this->isnewrecord){ // ... $this->status = self::visible; } return parent::beforesave(); }
i have tried returning true instead of parent::beforesave(). have tried if(parent::beforesave) {} structure.
i have checked model attributes in aftersave , set. don't there can lost afterwards.
any ideas?
basically updating model above..
if(!$this->isnewrecord).
remove conditin while saving status field
Comments
Post a Comment