In general, there is an attribute title for example. When you insert a record (action create), it is set to a value, for example, "Header". The question is how to prevent it from changing during the update? Those. That at action update it was not affected at all?

Value is assigned in beforeSave

public function beforeSave($insert) { if ( parent::beforeSave($insert) ) { echo 'insert'; exit(); $this->title = HtmlPurifier::process( $this->title ); } else { echo 'update'; exit(); } } 

I understand the problem is that it always returns 'insert'

  • one
    But nobody forces you to update absolutely all the fields of the table - Alexey Shimansky
  • And more? My value is assigned in beforeSave. Completed the question. - Passed by

0