1 | <?php |
||
16 | class MysqlConnection implements ConnectionInterface |
||
17 | { |
||
18 | /** @var \PDO */ |
||
19 | protected $pdo; |
||
20 | |||
21 | /** @var \Wandu\Database\Configuration */ |
||
22 | protected $config; |
||
23 | |||
24 | /** @var \Wandu\Event\DispatcherInterface */ |
||
25 | protected $dispatcher; |
||
26 | |||
27 | 19 | public function __construct( |
|
34 | |||
35 | /** |
||
36 | * {@inheritdoc} |
||
37 | */ |
||
38 | 19 | public function connect() |
|
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | 8 | public function fetch($query, array $bindings = []) |
|
59 | |||
60 | /** |
||
61 | * {@inheritdoc} |
||
62 | */ |
||
63 | public function all($query, array $bindings = []) |
||
67 | |||
68 | /** |
||
69 | * {@inheritdoc} |
||
70 | */ |
||
71 | 12 | public function first($query, array $bindings = []) |
|
76 | |||
77 | /** |
||
78 | * {@inheritdoc} |
||
79 | */ |
||
80 | 2 | public function query($query, array $bindings = []) |
|
84 | |||
85 | /** |
||
86 | * {@inheritdoc} |
||
87 | */ |
||
88 | 1 | public function getLastInsertId() |
|
92 | |||
93 | /** |
||
94 | * {@inheritdoc} |
||
95 | */ |
||
96 | public function transaction(callable $handler) |
||
110 | |||
111 | /** |
||
112 | * @param string|callable|\Wandu\Database\Contracts\QueryInterface $query |
||
113 | * @param array $bindings |
||
114 | * @return \PDOStatement |
||
115 | */ |
||
116 | 18 | protected function execute($query, array $bindings = []) |
|
133 | |||
134 | /** |
||
135 | * @param \PDOStatement $statement |
||
136 | * @param array $bindings |
||
137 | */ |
||
138 | 18 | protected function bindValues(PDOStatement $statement, array $bindings = []) |
|
157 | } |
||
158 |