1 | <?php |
||
13 | abstract class Table |
||
14 | { |
||
15 | /** |
||
16 | * @var Schema |
||
17 | */ |
||
18 | private $schema; |
||
19 | |||
20 | /** |
||
21 | * @var Driver |
||
22 | */ |
||
23 | private $driver; |
||
24 | |||
25 | /** |
||
26 | * @var TypeProvider |
||
27 | */ |
||
28 | private $types; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | private $name; |
||
34 | |||
35 | /** |
||
36 | * @var string|null |
||
37 | */ |
||
38 | private $alias; |
||
39 | |||
40 | /** |
||
41 | * @param Schema $schema |
||
42 | * @param Driver $driver |
||
43 | * @param TypeProvider $types |
||
44 | * @param string $name |
||
45 | * @param string|null $alias |
||
46 | */ |
||
47 | 1 | public function __construct(Schema $schema, Driver $driver, TypeProvider $types, $name, $alias) |
|
55 | |||
56 | /** |
||
57 | * @return Schema owner Schema instance |
||
58 | */ |
||
59 | 1 | public function getSchema() |
|
63 | |||
64 | /** |
||
65 | * @return string |
||
66 | */ |
||
67 | 1 | public function getName() |
|
71 | |||
72 | /** |
||
73 | * @return string|null |
||
74 | */ |
||
75 | 1 | public function getAlias() |
|
79 | |||
80 | /** |
||
81 | * @return string table expression (e.g. "{table} AS {alias}" for use in the FROM clause of an SQL statement) |
||
82 | */ |
||
83 | 1 | public function getNode() |
|
95 | |||
96 | /** |
||
97 | * @param string|null $prefix optional Column Alias prefix |
||
98 | * |
||
99 | * @return Column[] list of all available Columns |
||
100 | */ |
||
101 | 1 | public function listColumns($prefix = null) |
|
135 | |||
136 | /** |
||
137 | * @param string $name |
||
138 | * @param string $type Type class-name |
||
139 | * @param string|null $alias |
||
140 | * @param mixed $default |
||
141 | * |
||
142 | * @return Column |
||
143 | */ |
||
144 | 1 | protected function requiredColumn($name, $type, $alias = null, $default = null) |
|
148 | |||
149 | /** |
||
150 | * @param string $name |
||
151 | * @param string $type Type class-name |
||
152 | * @param string|null $alias |
||
153 | * @param mixed $default |
||
154 | * |
||
155 | * @return Column |
||
156 | */ |
||
157 | protected function optionalColumn($name, $type, $alias = null, $default = null) |
||
161 | |||
162 | /** |
||
163 | * @param string $name |
||
164 | * @param string $type Type class-name |
||
165 | * @param string|null $alias |
||
166 | * |
||
167 | * @return Column |
||
168 | */ |
||
169 | 1 | protected function autoColumn($name, $type, $alias = null) |
|
173 | |||
174 | /** |
||
175 | * @ignore |
||
176 | * |
||
177 | * @return string |
||
178 | */ |
||
179 | 1 | public function __toString() |
|
185 | |||
186 | /** |
||
187 | * @ignore |
||
188 | * |
||
189 | * @param string $name |
||
190 | * |
||
191 | * @return Column |
||
192 | */ |
||
193 | 1 | public function __get($name) |
|
199 | } |
||
200 |
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: