Browse Source

sp dataaccess

develop
Robin Thoni 8 years ago
parent
commit
178a351973

+ 1
- 1
src/Utils/DataAccess/LuDataAccess.php View File

@@ -27,7 +27,7 @@ abstract class LuDataAccess {
27 27
      */
28 28
     public static function getPdo()
29 29
     {
30
-        return Capsule::connection(static::$_connection)->getPdo();
30
+        return self::getConnection()->getPdo();
31 31
     }
32 32
 
33 33
     /**

+ 1
- 1
src/Utils/DataAccess/LuRequest.php View File

@@ -6,7 +6,7 @@
6 6
  * Time: 10:56 PM
7 7
  */
8 8
 
9
-namespace Luticate\Utils;
9
+namespace Luticate\Utils\DataAccess;
10 10
 
11 11
 
12 12
 use GuzzleHttp\Client;

+ 27
- 0
src/Utils/DataAccess/LuStoredProcedure.php View File

@@ -0,0 +1,27 @@
1
+<?php
2
+/**
3
+ * Created by PhpStorm.
4
+ * User: robin
5
+ * Date: 6/10/16
6
+ * Time: 2:37 PM
7
+ */
8
+
9
+namespace Luticate\Utils\DataAccess;
10
+
11
+use Illuminate\Database\Connection;
12
+use Luticate\Utils\Dbo\LuDbo;
13
+use Illuminate\Database\Capsule\Manager as Capsule;
14
+
15
+abstract class LuStoredProcedure
16
+{
17
+    protected static $_connection = "mydb";
18
+    protected static $_dboClass = LuDbo::class;
19
+
20
+    /**
21
+     * @return Connection
22
+     */
23
+    public static function getConnection()
24
+    {
25
+        return Capsule::connection(static::$_connection);
26
+    }
27
+}

+ 0
- 8
src/Utils/Dbo/LuSpDbo.php View File

@@ -1,8 +0,0 @@
1
-<?php
2
-
3
-namespace Luticate\Utils\Dbo;
4
-
5
-abstract class LuSpDbo extends LuDbo
6
-{
7
-
8
-}

+ 2
- 2
tests/DatabaseTest.php View File

@@ -169,7 +169,7 @@ class DatabaseTest extends \PHPUnit_Framework_TestCase
169 169
 
170 170
         $pdo = TestTableDataAccess::getPdo();
171 171
         $pgsql = new PgSqlDataAccess();
172
-        $pgsql->getStoredProceduresFull($pdo);
173
-//        var_dump($pgsql->getStoredProceduresFull($pdo));
172
+//        $pgsql->getStoredProceduresFull($pdo);
173
+        var_dump($pgsql->getStoredProceduresFull($pdo));
174 174
     }
175 175
 }

Loading…
Cancel
Save