source/Spiral/Database/Drivers/Postgres/Schemas/ColumnSchema.php 1 location
|
@@ 168-178 (lines=11) @@
|
| 165 |
|
/** |
| 166 |
|
* {@inheritdoc} |
| 167 |
|
*/ |
| 168 |
|
public function enum($values) |
| 169 |
|
{ |
| 170 |
|
$this->enumValues = array_map('strval', is_array($values) ? $values : func_get_args()); |
| 171 |
|
|
| 172 |
|
$this->type = 'character'; |
| 173 |
|
foreach ($this->enumValues as $value) { |
| 174 |
|
$this->size = max((int)$this->size, strlen($value)); |
| 175 |
|
} |
| 176 |
|
|
| 177 |
|
return $this; |
| 178 |
|
} |
| 179 |
|
|
| 180 |
|
/** |
| 181 |
|
* {@inheritdoc} |
source/Spiral/Database/Drivers/SQLServer/Schemas/ColumnSchema.php 1 location
|
@@ 152-163 (lines=12) @@
|
| 149 |
|
/** |
| 150 |
|
* {@inheritdoc} |
| 151 |
|
*/ |
| 152 |
|
public function enum($values) |
| 153 |
|
{ |
| 154 |
|
$this->enumValues = array_map('strval', is_array($values) ? $values : func_get_args()); |
| 155 |
|
sort($this->enumValues); |
| 156 |
|
|
| 157 |
|
$this->type = 'varchar'; |
| 158 |
|
foreach ($this->enumValues as $value) { |
| 159 |
|
$this->size = max((int)$this->size, strlen($value)); |
| 160 |
|
} |
| 161 |
|
|
| 162 |
|
return $this; |
| 163 |
|
} |
| 164 |
|
|
| 165 |
|
/** |
| 166 |
|
* {@inheritdoc} |