Total Complexity | 4 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | abstract class AbstractSeed |
||
9 | { |
||
10 | public function __construct() |
||
15 | ]); |
||
16 | } |
||
17 | |||
18 | abstract public function create(); |
||
19 | |||
20 | protected function createStmtString(array $fields) |
||
21 | { |
||
22 | $insert = []; |
||
23 | $execute = []; |
||
24 | |||
25 | foreach ($fields as $key => $data) { |
||
26 | $insert[] = "{$key}"; |
||
27 | $execute[] = ":{$key}"; |
||
28 | } |
||
29 | |||
30 | return [implode(",", $insert), implode(",", $execute)]; |
||
31 | } |
||
32 | |||
33 | protected function execute(string $table, array $fields) |
||
42 | } |
||
43 | } |
||
44 |