web-base/Core/Driver/SQL/Column/EnumColumn.class.php

20 lines
446 B
PHP
Raw Permalink Normal View History

2020-04-02 00:02:51 +02:00
<?php
2022-11-18 18:06:46 +01:00
namespace Core\Driver\SQL\Column;
2020-04-02 00:02:51 +02:00
class EnumColumn extends Column {
2020-04-03 17:39:58 +02:00
private array $values;
2020-04-02 00:02:51 +02:00
2021-04-02 21:58:06 +02:00
public function __construct(string $name, array $values, bool $nullable = false, $defaultValue = NULL) {
2020-04-02 00:02:51 +02:00
parent::__construct($name, $nullable, $defaultValue);
$this->values = $values;
}
2022-06-14 16:55:53 +02:00
public function addValue(string $value) {
2021-12-08 16:53:43 +01:00
$this->values[] = $value;
}
2021-04-02 21:58:06 +02:00
public function getValues(): array { return $this->values; }
2020-04-02 00:02:51 +02:00
}