| @@ 414-421 (lines=8) @@ | ||
| 411 | foreach ($constraints as $constraint) { |
|
| 412 | if (preg_match('/ARRAY\[([^\]]+)\]/', $constraint['consrc'], $matches)) { |
|
| 413 | $enumValues = explode(',', $matches[1]); |
|
| 414 | foreach ($enumValues as &$value) { |
|
| 415 | if (preg_match("/^'?(.*?)'?::(.+)/", trim($value), $matches)) { |
|
| 416 | //In database: 'value'::TYPE |
|
| 417 | $value = $matches[1]; |
|
| 418 | } |
|
| 419 | ||
| 420 | unset($value); |
|
| 421 | } |
|
| 422 | ||
| 423 | $column->enumValues = $enumValues; |
|
| 424 | $column->constrainName = $constraint['conname']; |
|
| @@ 203-211 (lines=9) @@ | ||
| 200 | $matches |
|
| 201 | )) { |
|
| 202 | $enumValues = explode(',', $matches[1]); |
|
| 203 | foreach ($enumValues as &$value) { |
|
| 204 | //Trimming values |
|
| 205 | if (preg_match("/^'?(.*?)'?$/", trim($value), $matches)) { |
|
| 206 | //In database: 'value' |
|
| 207 | $value = $matches[1]; |
|
| 208 | } |
|
| 209 | ||
| 210 | unset($value); |
|
| 211 | } |
|
| 212 | ||
| 213 | $column->enumValues = $enumValues; |
|
| 214 | } |
|