1 | <?php |
||
32 | trait TransactionTrait |
||
33 | { |
||
34 | /** |
||
35 | * In transaction or not |
||
36 | * |
||
37 | * @var bool |
||
38 | * @access protected |
||
39 | */ |
||
40 | protected $transaction = false; |
||
41 | |||
42 | /** |
||
43 | * {@inheritDoc} |
||
44 | */ |
||
45 | public function inTransaction()/*# : bool */ |
||
49 | |||
50 | /** |
||
51 | * {@inheritDoc} |
||
52 | */ |
||
53 | public function begin() |
||
60 | |||
61 | /** |
||
62 | * {@inheritDoc} |
||
63 | */ |
||
64 | public function commit() |
||
72 | |||
73 | /** |
||
74 | * {@inheritDoc} |
||
75 | */ |
||
76 | public function rollback() |
||
90 | |||
91 | /** |
||
92 | * Driver specific begin transaction |
||
93 | * |
||
94 | * @access protected |
||
95 | */ |
||
96 | abstract protected function realBegin(); |
||
97 | |||
98 | /** |
||
99 | * Driver specific commit |
||
100 | * |
||
101 | * @access protected |
||
102 | */ |
||
103 | abstract protected function realCommit(); |
||
104 | |||
105 | /** |
||
106 | * Driver specific rollback |
||
107 | * |
||
108 | * @access protected |
||
109 | */ |
||
110 | abstract protected function realRollback(); |
||
111 | |||
112 | /* from other traits */ |
||
113 | abstract public function connect(); |
||
115 | } |
||
116 |