Conditions | 3 |
Paths | 3 |
Total Lines | 32 |
Code Lines | 24 |
Lines | 0 |
Ratio | 0 % |
1 | <?php |
||
17 | public function __construct(array $args) |
||
18 | { |
||
19 | /** @var BaseColumn $baseColumn */ |
||
20 | $baseColumn = $args['column']; |
||
21 | |||
22 | $optionNames = [ |
||
23 | 'Length', |
||
24 | 'Precision', |
||
25 | 'Scale', |
||
26 | 'Unsigned', |
||
27 | 'Fixed', |
||
28 | 'Notnull', |
||
29 | 'Default', |
||
30 | 'Autoincrement', |
||
31 | 'Comment' |
||
32 | ]; |
||
33 | |||
34 | $options = []; |
||
35 | foreach ($optionNames as $name) { |
||
36 | $method = "get" . $name; |
||
37 | $val = $baseColumn->$method(); |
||
38 | if ($this->$method() !== $val) { |
||
39 | $options[$name] = $val; |
||
40 | } |
||
41 | } |
||
42 | $this->_setName($baseColumn->getName()); |
||
43 | $this->_type = $baseColumn->getType(); |
||
44 | $this->setOptions($options); |
||
45 | $this->setColumnDefinition($baseColumn->getColumnDefinition()); |
||
46 | $this->setPlatformOptions($baseColumn->getPlatformOptions()); |
||
47 | $this->setCustomSchemaOptions($baseColumn->getCustomSchemaOptions()); |
||
48 | } |
||
49 | |||
60 |