コード例 #1
0
ファイル: request.php プロジェクト: ydhl/yangzie
 public function get_modify_model()
 {
     $class = $this->get_from_post("yze_model_name");
     if (!class_exists($class)) {
         return null;
     }
     $key = $this->get_from_post("yze_model_id");
     if (!$key) {
         return null;
     }
     return YZE_Model::find($key, $class);
 }
コード例 #2
0
ファイル: model.php プロジェクト: ydhl/yangzie
 /**
  * 从数据库中刷新
  * 
  * @author leeboo
  * 
  * 
  * @return
  */
 public function refresh()
 {
     $new = YZE_Model::find($this->get_key(), get_class($this));
     if ($new) {
         foreach ($new->get_records() as $name => $value) {
             $this->set($name, $value);
         }
     }
     return $this;
 }