Example #1
0
 protected function afterFind()
 {
     // загружаем userinfo
     $r = Yii::app()->db->createCommand("SELECT prop_id, value FROM userinfo WHERE user_id = :user_id")->query(array(":user_id" => $this->id));
     foreach ($r as $row) {
         $attr = self::$Properties[$row["prop_id"]][1];
         if ($attr == "bdate") {
             list($this->bdate_y, $this->bdate_m, $this->bdate_d) = sscanf($row["value"], "%d-%d-%d");
             foreach (array("bdate_y", "bdate_m", "bdate_d") as $k) {
                 if ($this->{$k} == 0) {
                     $this->{$k} = "";
                 }
             }
         }
         $this->{$attr} = $row["value"];
     }
     parent::afterFind();
 }
Example #2
0
 protected function afterFind()
 {
     parent::afterFind();
     $this->set_ini = $this->ini;
 }