瀏覽代碼

fixed generator for utils upgrade

tags/0.1.0
Robin Thoni 9 年之前
父節點
當前提交
e6940594f0
共有 2 個檔案被更改,包括 4 行新增5 行删除
  1. 2
    2
      src/Generator/business.php.twig
  2. 2
    3
      src/Generator/dataaccess.php.twig

+ 2
- 2
src/Generator/business.php.twig 查看文件

@@ -7,8 +7,8 @@ use {{ dataaccess_namespace.as_it }}\{{ data_access_name.as_it }};
7 7
 use {{ dbo_namespace.as_it }}\{{ dbo_name.as_it }};
8 8
 
9 9
 class {{ business_name.as_it }} extends LuBusiness {
10
-    public function __construct()
10
+    protected static function getDataAccess()
11 11
     {
12
-        $this->dataAccess = new {{ data_access_name.as_it }}();
12
+        return new {{ data_access_name.as_it }}();
13 13
     }
14 14
 }

+ 2
- 3
src/Generator/dataaccess.php.twig 查看文件

@@ -7,9 +7,8 @@ use {{ models_namespace.as_it }}\{{ model_user_name.as_it }};
7 7
 use {{ dbo_namespace.as_it }}\{{ dbo_name.as_it }};
8 8
 
9 9
 class {{ data_access_name.as_it }} extends LuDataAccess {
10
-    public function __construct()
10
+    protected static function getModel()
11 11
     {
12
-        parent::__construct();
13
-        $this->model = new {{ model_user_name.as_it }}();
12
+        return new {{ model_user_name.as_it }}();
14 13
     }
15 14
 }

Loading…
取消
儲存