1 | <?php |
||
5 | class AdapterFactory |
||
6 | { |
||
7 | /** |
||
8 | * Create adapter from an existing doctrine/dbal connection. |
||
9 | * |
||
10 | * @param \Illuminate\Database\Capsule\Manager $capsule |
||
11 | * |
||
12 | * @return \Soluble\DbWrapper\Adapter\Laravel\Capsule5Adapter |
||
13 | */ |
||
14 | 1 | public static function createAdapterFromCapsule5(\Illuminate\Database\Capsule\Manager $capsule) |
|
18 | |||
19 | /** |
||
20 | * Create adapter from an existing doctrine/dbal connection. |
||
21 | * |
||
22 | * @param \Doctrine\DBAL\Connection $dbalConnection |
||
23 | * |
||
24 | * @return \Soluble\DbWrapper\Adapter\Doctrine\Dbal2Adapter |
||
25 | */ |
||
26 | 1 | public static function createAdapterFromDoctrine2(\Doctrine\DBAL\Connection $dbalConnection) |
|
30 | |||
31 | /** |
||
32 | * Create adapter from an existing zendframework/zend-db adapter. |
||
33 | * |
||
34 | * @param \Zend\Db\Adapter\Adapter $zendAdapter |
||
35 | * |
||
36 | * @return \Soluble\DbWrapper\Adapter\Zend\ZendDb2Adapter |
||
37 | */ |
||
38 | 1 | public static function createAdapterFromZendDb2(\Zend\Db\Adapter\Adapter $zendAdapter) |
|
42 | |||
43 | /** |
||
44 | * Create adapter from an existing connection resource. |
||
45 | * |
||
46 | * @param mixed $resource database connection object (mysqli, pdo_mysql,...) |
||
47 | * |
||
48 | * @throws Exception\InvalidArgumentException |
||
49 | * @throws Exception\UnsupportedDriverException |
||
50 | * |
||
51 | * @return Adapter\AdapterInterface |
||
52 | */ |
||
53 | 5 | public static function createAdapterFromResource($resource) |
|
68 | |||
69 | /** |
||
70 | * Get an adapter from an existing connection resource. |
||
71 | * |
||
72 | * @param \PDO $resource database connection object |
||
73 | * |
||
74 | * @throws Exception\UnsupportedDriverException |
||
75 | * |
||
76 | * @return Adapter\AdapterInterface |
||
77 | */ |
||
78 | 2 | protected static function getAdapterFromPdo(\PDO $resource) |
|
95 | } |
||
96 |