1 | <?php |
||
14 | class InsertQuery extends Query |
||
15 | { |
||
16 | /** |
||
17 | * @var Driver |
||
18 | */ |
||
19 | private $driver; |
||
20 | |||
21 | /** |
||
22 | * @var Table |
||
23 | */ |
||
24 | private $table; |
||
25 | |||
26 | /** |
||
27 | * @var Column[] |
||
28 | */ |
||
29 | private $columns; |
||
30 | |||
31 | /** |
||
32 | * @var string[] list of tuple expressions |
||
33 | */ |
||
34 | private $tuples = []; |
||
35 | |||
36 | /** |
||
37 | * @param Driver $driver |
||
38 | * @param TypeProvider $types |
||
39 | * @param Table $table Table to INSERT into |
||
40 | */ |
||
41 | 1 | public function __construct(Driver $driver, TypeProvider $types, Table $table) |
|
60 | |||
61 | |||
62 | /** |
||
63 | * Add a record to this INSERT query. |
||
64 | * |
||
65 | * @param array $record record map (where Column name => value) |
||
66 | * |
||
67 | * @return $this |
||
68 | */ |
||
69 | 1 | public function add(array $record) |
|
97 | |||
98 | /** |
||
99 | * @inheritdoc |
||
100 | */ |
||
101 | 1 | public function getSQL() |
|
121 | } |
||
122 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: