Exemple #1
0
 /**
  * Returns the static model of the specified AR class.
  * Please note that you should have this exact method in all your CActiveRecord descendants!
  * @param string $className active record class name.
  * @return Project the static model class
  */
 public static function model($className = __CLASS__)
 {
     return parent::model($className);
 }
Exemple #2
0
 /**
  * apply hash to password before storing in database
  */
 protected function afterValidate()
 {
     parent::afterValidate();
     //ensure we don't have any errors
     if (!$this->hasErrors()) {
         $this->password = $this->hashPassword($this->password);
     }
 }