title: How to edit automatically generated model in Yii framework?
body: <pre><code>protected function beforeSave()
  {
    if(parent::beforeSave())
    {
       if($this-&gt;isNewRecord)
       {
          $this-&gt;create_time = $this-&gt;update_time=time();
          $this-&gt;author_id = Yii::app()-&gt;user-&gt;id;
       }
       else
          $this-&gt;update_time = time();
       return true;
   }
   else
      return false;
  </code></pre>
  
  <p>}</p>
  
  <p>Above is a sample code of model.
  Can anybody tell me how to edit such automatic generated code in Yii?</p>