title: simple afterSave method doesn't work in Yii
body: <p>I wanna update a field in inserted raw by <code>afterSave</code> method,so I develop following code in Driver Model</p>
  
  <pre><code>protected function afterSave() {
          parent::afterSave();
          if ($this-&gt;isNewRecord) {
              $newid = self::newid($this-&gt;id);
              $this-&gt;updateByPk($this-&gt;id, new CDbCriteria(array('condition'=&gt;'driverid = :driverid', 'params'=&gt;array('driverid'=&gt;  $newid))));
          }
  }
  </code></pre>
  
  <p>and in Controller the method which crud made:</p>
  
  <pre><code>public function actionCreate()
  {
      $model=new Driver;
  
      // Uncomment the following line if AJAX validation is needed
      // $this-&gt;performAjaxValidation($model);
  
      if(isset($_POST['Driver']))
      {
          $model-&gt;attributes=$_POST['Driver'];
          if($model-&gt;save())
              $this-&gt;redirect(array('view','id'=&gt;$model-&gt;id));
      }
  
      $this-&gt;render('create',array(
          'model'=&gt;$model,
      ));
  }
  </code></pre>
  
  <h2>why after save doesn't work?</h2>
  
  <p>edit:</p>
  
  <pre><code>    private static function CheckNumber($number) {
          $array = array(10);
          for ($i = 0; $i &lt; 10; $i++)
              $array[$i] = 0;
          do {
              $array[$number % 10]++;
              $number /= 10;
          } while ((int) ($number / 10 ) != 0);
          $array[$number]++;
  
          for ($i = 0; $i &lt; 10; $i++)
              if ($array[$i] &gt; 1)
                  return false;
          return true;
      }
  
  public static function newid($id) {
      while (self::CheckNumber($id) == FALSE) {
          $id++;
      }
      return $id;
  }
  </code></pre>