Browse Source

default arg name for sp

develop
Robin Thoni 8 years ago
parent
commit
81dfbfc1be
1 changed files with 8 additions and 3 deletions
  1. 8
    3
      src/Utils/DataAccess/PgSqlDataAccess.php

+ 8
- 3
src/Utils/DataAccess/PgSqlDataAccess.php View File

244
         {
244
         {
245
             $sp_ = $spQuery->fetchAll();
245
             $sp_ = $spQuery->fetchAll();
246
             $sps = array("in" => array(), "out" => array());
246
             $sps = array("in" => array(), "out" => array());
247
-            foreach ($sp_ as $p)
248
-                $sps[strtolower($p["parameter_mode"])][] = $p;
247
+            foreach ($sp_ as $p) {
248
+                $type = strtolower($p["parameter_mode"]);
249
+                if (empty($p["name"])) {
250
+                    $p["name"] = "arg" . count($sps[$type]);
251
+                }
252
+                $sps[$type][] = $p;
253
+            }
249
             $out_count = count($sps['out']);
254
             $out_count = count($sps['out']);
250
             if ($out_count == 0)
255
             if ($out_count == 0)
251
             {
256
             {
252
                 $sps['out'][] = array(
257
                 $sps['out'][] = array(
253
-                    "name" => $sp_name,
258
+                    "name" => empty($sp_name) ? "arg" . count($sps['out']) : $sp_name,
254
                     "data_type" => $sp["data_type"],
259
                     "data_type" => $sp["data_type"],
255
                     "parameter_mode" => "OUT"
260
                     "parameter_mode" => "OUT"
256
                 );
261
                 );

Loading…
Cancel
Save