2020-04-02 00:02:51 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Driver\SQL\Column;
|
|
|
|
|
|
|
|
class Column {
|
|
|
|
|
2020-04-03 17:39:58 +02:00
|
|
|
private string $name;
|
|
|
|
private bool $nullable;
|
2020-04-02 00:02:51 +02:00
|
|
|
private $defaultValue;
|
|
|
|
|
2021-04-02 21:58:06 +02:00
|
|
|
public function __construct(string $name, bool $nullable = false, $defaultValue = NULL) {
|
2020-04-02 00:02:51 +02:00
|
|
|
$this->name = $name;
|
|
|
|
$this->nullable = $nullable;
|
|
|
|
$this->defaultValue = $defaultValue;
|
|
|
|
}
|
|
|
|
|
2021-04-02 21:58:06 +02:00
|
|
|
public function getName(): string { return $this->name; }
|
|
|
|
public function notNull(): bool { return !$this->nullable; }
|
2020-04-02 00:02:51 +02:00
|
|
|
public function getDefaultValue() { return $this->defaultValue; }
|
|
|
|
|
2020-04-03 17:39:58 +02:00
|
|
|
}
|