1 | <?php |
||
9 | class RetryConnection implements Connection |
||
10 | { |
||
11 | private $wrappedConnectionParams; |
||
12 | private $wrappedConnection; |
||
13 | private $retryStrategy; |
||
14 | private $transactionLevel = 0; |
||
15 | |||
16 | use CallAndRetry; |
||
17 | |||
18 | public function __construct(Array $wrappedConnectionParams, RetryStrategy $retryStrategy) |
||
23 | |||
24 | /** |
||
25 | * Prepares a statement for execution and returns a Statement object. |
||
26 | * |
||
27 | * @param string $prepareString |
||
28 | * |
||
29 | * @return \Doctrine\DBAL\Driver\Statement |
||
30 | */ |
||
31 | public function prepare($prepareString) { |
||
38 | |||
39 | /** |
||
40 | * Executes an SQL statement, returning a result set as a Statement object. |
||
41 | * |
||
42 | * @return \Doctrine\DBAL\Driver\Statement |
||
43 | */ |
||
44 | public function query() { |
||
47 | |||
48 | /** |
||
49 | * Quotes a string for use in a query. |
||
50 | * |
||
51 | * @param string $input |
||
52 | * @param integer $type |
||
53 | * |
||
54 | * @return string |
||
55 | */ |
||
56 | public function quote($input, $type = \PDO::PARAM_STR) { |
||
59 | |||
60 | /** |
||
61 | * Executes an SQL statement and return the number of affected rows. |
||
62 | * |
||
63 | * @param string $statement |
||
64 | * |
||
65 | * @return integer |
||
66 | */ |
||
67 | public function exec($statement) { |
||
70 | |||
71 | /** |
||
72 | * Returns the ID of the last inserted row or sequence value. |
||
73 | * |
||
74 | * @param string|null $name |
||
75 | * |
||
76 | * @return string |
||
77 | */ |
||
78 | public function lastInsertId($name = null) { |
||
81 | |||
82 | /** |
||
83 | * Initiates a transaction. |
||
84 | * |
||
85 | * @return boolean TRUE on success or FALSE on failure. |
||
86 | */ |
||
87 | public function beginTransaction() { |
||
91 | |||
92 | /** |
||
93 | * Commits a transaction. |
||
94 | * |
||
95 | * @return boolean TRUE on success or FALSE on failure. |
||
96 | */ |
||
97 | public function commit() { |
||
101 | |||
102 | /** |
||
103 | * Rolls back the current transaction, as initiated by beginTransaction(). |
||
104 | * |
||
105 | * @return boolean TRUE on success or FALSE on failure. |
||
106 | */ |
||
107 | public function rollBack() { |
||
111 | |||
112 | /** |
||
113 | * Returns the error code associated with the last operation on the database handle. |
||
114 | * |
||
115 | * @return string|null The error code, or null if no operation has been run on the database handle. |
||
116 | */ |
||
117 | public function errorCode() { |
||
120 | |||
121 | /** |
||
122 | * Returns extended error information associated with the last operation on the database handle. |
||
123 | * |
||
124 | * @return array |
||
125 | */ |
||
126 | public function errorInfo() { |
||
129 | |||
130 | public function close() |
||
134 | |||
135 | public function transactionLevel() |
||
139 | |||
140 | private function callWrappedConnectionAndRetry($method, array $arguments) |
||
146 | |||
147 | public function wrappedConnection() |
||
156 | } |
||
157 |