| Total Complexity | 3 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class Insert extends Query |
||
| 6 | { |
||
| 7 | public function __construct(string $table, array $dat_ass) |
||
| 8 | { |
||
| 9 | // Check if the given data is a non-empty array, and throw an exception if it is not |
||
| 10 | if (empty($dat_ass)) { |
||
| 11 | throw new \InvalidArgumentException('EMPTY_DATA'); |
||
| 12 | } |
||
| 13 | |||
| 14 | $this->table = $table; |
||
| 15 | $this->addBindings($dat_ass); |
||
| 16 | } |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Generates the SQL INSERT statement |
||
| 20 | * |
||
| 21 | * @return string - The generated SQL INSERT statement |
||
| 22 | */ |
||
| 23 | public function statement(): string |
||
| 33 | } |
||
| 34 | } |
||
| 35 |