public function __construct(
?string $type = null,
private bool $autoIncrement = false,
private ?string $check = null,
private ?string $comment = null,
private bool $computed = false,
private ?string $dbType = null,
private ?string $extra = null,
private bool $primaryKey = false,
private ?string $name = null,
private ?bool $notNull = null,
private ?ForeignKey $reference = null,
private ?int $scale = null,
private ?int $size = null,
private bool $unique = false,
private bool $unsigned = false,
mixed ...$args,
) {
$this->type = $type ?? static::DEFAULT_TYPE;
if (array_key_exists('defaultValue', $args)) {
$this->defaultValue = $args['defaultValue'];
unset($args['defaultValue']);
}
foreach ($args as $property => $value) {
if (property_exists($this, $property)) {
$this->$property = $value;
}
}
}
Signup or Login in order to comment.