64], [['header'], 'string', 'max' => 190], ]; } public function beforeSave($insert) { if (!parent::beforeSave($insert)) { return false; } $now = date('Y-m-d H:i:s'); if ($insert && empty($this->created_at)) { $this->created_at = $now; } $this->updated_at = $now; if ($this->sort_order === null) { $this->sort_order = 100; } if ($this->is_active === null) { $this->is_active = 1; } return true; } }