Browse Source

fixed sp generation

tags/0.1.0
Robin Thoni 8 years ago
parent
commit
782392e22c
2 changed files with 9 additions and 3 deletions
  1. 4
    3
      src/Generator/LuGenerator.php
  2. 5
    0
      src/Generator/sp.php.twig

+ 4
- 3
src/Generator/LuGenerator.php View File

@@ -227,11 +227,12 @@ ORDER BY parameters.ordinal_position;");
227 227
             return $this->printError($spQuery, "Failed to get arguments for stored procedure " . $sp_name);
228 228
     }
229 229
 
230
-    public function generateSp($sp, $args, $file)
230
+    public function generateSp($sp, $args, $file, $namespace)
231 231
     {
232 232
         $vars = array(
233 233
             "sp" => $sp,
234
-            "args" => $args
234
+            "args" => $args,
235
+            "namespace" => $namespace
235 236
         );
236 237
         $this->buildTwig('sp.php', $file, $vars);
237 238
     }
@@ -320,7 +321,7 @@ ORDER BY parameters.ordinal_position;");
320 321
                 $args["in"] = $this->sqlTypesToPhpTypes($args["in"]);
321 322
                 $args["out"] = $this->sqlTypesToPhpTypes($args["out"]);
322 323
                 $sp_model_name = $this->snakeToCamelCase($sp_name, true);
323
-                $this->generateSp($sp, $args, $sp_dir . $sp_model_name . ".php");
324
+                $this->generateSp($sp, $args, $sp_dir . $sp_model_name . ".php", $this->_config["sp"]["namespace"]);
324 325
             }
325 326
         }
326 327
     }

+ 5
- 0
src/Generator/sp.php.twig View File

@@ -1,5 +1,10 @@
1 1
 {{ "<?php" }}
2 2
 
3
+/**
4
+ * AUTO GENERATED BY LUTICATE GENERATOR
5
+ * ANY CHANGES WILL BE OVERWRITTEN
6
+ */
7
+
3 8
 namespace {{ namespace.as_it }};
4 9
 
5 10
 use Luticate\Utils\LuSpModel;

Loading…
Cancel
Save