1 | <?php |
||
24 | abstract class AbstractDBHelper |
||
25 | { |
||
26 | /** |
||
27 | * Execute (or not) queries |
||
28 | * @var bool |
||
29 | */ |
||
30 | public $pretend = false; |
||
31 | |||
32 | /** |
||
33 | * DBAL connection |
||
34 | * @var Connection |
||
35 | */ |
||
36 | public $conn = null; |
||
37 | |||
38 | |||
39 | /** |
||
40 | * Requires a connection to work |
||
41 | * @param Connection $conn |
||
42 | */ |
||
43 | public function __construct(Connection $conn) |
||
47 | |||
48 | /** |
||
49 | * Set Pretend to true to simulate queries, false to execute interface |
||
50 | * @param bool $pretend |
||
51 | */ |
||
52 | public function setPretend(bool $pretend) |
||
56 | |||
57 | /** |
||
58 | * Get, for a driver options for connection (PDO) |
||
59 | * @return array |
||
60 | */ |
||
61 | public static function getDriverOptions(): array |
||
65 | |||
66 | /** |
||
67 | * Set the right enclosure |
||
68 | * @return string |
||
69 | */ |
||
70 | public function getEnclosureForCSV(): string |
||
74 | |||
75 | |||
76 | /** |
||
77 | * Load Data from a CSV |
||
78 | * @param string $table |
||
79 | * @param string $filename |
||
80 | * @param array $fields |
||
81 | * @param string $mode Not in used here |
||
82 | * @return string |
||
83 | */ |
||
84 | abstract public function loadData( |
||
90 | } |
||
91 |