| 1 | <?php |
||
| 5 | class Column |
||
| 6 | { |
||
| 7 | /** @var string */ |
||
| 8 | protected $name; |
||
| 9 | |||
| 10 | /** @var Type */ |
||
| 11 | protected $type; |
||
| 12 | |||
| 13 | /** @var bool */ |
||
| 14 | protected $hasDefault; |
||
| 15 | |||
| 16 | /** @var bool */ |
||
| 17 | protected $isNullable; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Column constructor. |
||
| 21 | * |
||
| 22 | * @param string $name |
||
| 23 | * @param Type $type |
||
| 24 | * @param bool $hasDefault |
||
| 25 | * @param bool $isNullable |
||
| 26 | */ |
||
| 27 | 85 | public function __construct($name, Type $type, $hasDefault, $isNullable) |
|
| 34 | |||
| 35 | 85 | public static function factory($columnDefinition, $type) |
|
| 42 | |||
| 43 | /** |
||
| 44 | * @return string |
||
| 45 | */ |
||
| 46 | 3 | public function getName() |
|
| 50 | |||
| 51 | /** |
||
| 52 | * @return Type |
||
| 53 | */ |
||
| 54 | 66 | public function getType() |
|
| 58 | |||
| 59 | /** |
||
| 60 | * @return bool |
||
| 61 | */ |
||
| 62 | 10 | public function hasDefault() |
|
| 66 | |||
| 67 | /** |
||
| 68 | * @return bool |
||
| 69 | */ |
||
| 70 | 6 | public function isNullable() |
|
| 74 | } |
||
| 75 |