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

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -