1 | <?php |
||
20 | class DBAL extends \Aimeos\MW\DB\Connection\Base implements \Aimeos\MW\DB\Connection\Iface |
||
21 | { |
||
22 | private $connection; |
||
23 | private $txnumber = 0; |
||
24 | private $stmts = array(); |
||
25 | |||
26 | |||
27 | /** |
||
28 | * Initializes the DBAL connection object |
||
29 | * |
||
30 | * @param array $params Associative list of connection parameters |
||
31 | * @param string[] $stmts List of SQL statements to execute after connecting |
||
32 | */ |
||
33 | public function __construct( array $params, array $stmts ) |
||
40 | |||
41 | |||
42 | /** |
||
43 | * Connects (or reconnects) to the database server |
||
44 | * |
||
45 | * @return \Aimeos\MW\DB\Connection\Iface Connection instance for method chaining |
||
46 | */ |
||
47 | public function connect() |
||
63 | |||
64 | |||
65 | /** |
||
66 | * Creates a DBAL database statement |
||
67 | * |
||
68 | * @param string $sql SQL statement, maybe with place holders |
||
69 | * @param integer $type Simple or prepared statement type constant from abstract class |
||
70 | * @return \Aimeos\MW\DB\Statement\Iface \PDO statement object |
||
71 | * @throws \Aimeos\MW\DB\Exception if type is invalid or the DBAL object throws an exception |
||
72 | */ |
||
73 | public function create( $sql, $type = \Aimeos\MW\DB\Connection\Base::TYPE_SIMPLE ) |
||
92 | |||
93 | |||
94 | /** |
||
95 | * Returns the underlying connection object |
||
96 | * |
||
97 | * @return \Doctrine\DBAL\Connection Underlying connection object |
||
98 | */ |
||
99 | public function getRawObject() |
||
103 | |||
104 | |||
105 | /** |
||
106 | * Checks if a transaction is currently running |
||
107 | * |
||
108 | * @return boolean True if transaction is currently running, false if not |
||
109 | */ |
||
110 | public function inTransaction() |
||
118 | |||
119 | |||
120 | /** |
||
121 | * Starts a transaction for this connection. |
||
122 | * |
||
123 | * Transactions can't be nested and a new transaction can only be started |
||
124 | * if the previous transaction was committed or rolled back before. |
||
125 | */ |
||
126 | public function begin() |
||
135 | |||
136 | |||
137 | /** |
||
138 | * Commits the changes done inside of the transaction to the storage. |
||
139 | */ |
||
140 | public function commit() |
||
149 | |||
150 | |||
151 | /** |
||
152 | * Discards the changes done inside of the transaction. |
||
153 | */ |
||
154 | public function rollback() |
||
170 | } |
||
171 |