コード例 #1
0
ファイル: Func.php プロジェクト: AllenLyu/ko
 /**
  * 自动创建 $xxxDao 对象
  *
  * @return mixed
  */
 public function __get($sName)
 {
     if ('Dao' === substr($sName, -3)) {
         $dao = Ko_Tool_Object::OCreateInThisModule($this, 'Dao');
         $this->{$sName} = $dao->oGetDao($sName);
         return $this->{$sName};
     }
     return null;
 }
コード例 #2
0
ファイル: Api.php プロジェクト: firaga/operation
 /**
  * 自动创建 $xxxApi | $xxxFunc | $xxxDao 对象
  *
  * @return mixed
  */
 public function __get($sName)
 {
     if ('Api' === substr($sName, -3)) {
         $this->{$sName} = Ko_Tool_Object::OCreate($this, $sName);
         return $this->{$sName};
     } else {
         if ('Func' === substr($sName, -4)) {
             $this->{$sName} = Ko_Tool_Object::OCreateInThisModule($this, $sName);
             return $this->{$sName};
         }
     }
     return parent::__get($sName);
 }