1 | <?php |
||
19 | class PdoWriter implements Writer, FlushableWriter |
||
20 | { |
||
21 | /** |
||
22 | * @var \PDO |
||
23 | */ |
||
24 | protected $pdo; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $tableName; |
||
30 | |||
31 | /** |
||
32 | * @var \PDOStatement |
||
33 | */ |
||
34 | protected $statement; |
||
35 | |||
36 | /** |
||
37 | * @var array |
||
38 | */ |
||
39 | private $stack; |
||
40 | |||
41 | /** |
||
42 | * Note if your table name is a reserved word for your target DB you should quote it in the appropriate way e.g. |
||
43 | * for MySQL enclose the name in `backticks`. |
||
44 | * |
||
45 | * @param \PDO $pdo |
||
46 | * @param string $tableName |
||
47 | */ |
||
48 | 6 | public function __construct(\PDO $pdo, $tableName) |
|
57 | |||
58 | 4 | public function prepare() |
|
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | 4 | public function writeItem(array $item) |
|
84 | |||
85 | 2 | public function finish() |
|
91 | |||
92 | 2 | public function flush() |
|
108 | } |
||
109 |