| @@ 409-416 (lines=8) @@ | ||
| 406 | foreach ($constraints as $constraint) { |
|
| 407 | if (preg_match('/ARRAY\[([^\]]+)\]/', $constraint['consrc'], $matches)) { |
|
| 408 | $enumValues = explode(',', $matches[1]); |
|
| 409 | foreach ($enumValues as &$value) { |
|
| 410 | if (preg_match("/^'?(.*?)'?::(.+)/", trim($value), $matches)) { |
|
| 411 | //In database: 'value'::TYPE |
|
| 412 | $value = $matches[1]; |
|
| 413 | } |
|
| 414 | ||
| 415 | unset($value); |
|
| 416 | } |
|
| 417 | ||
| 418 | $column->enumValues = $enumValues; |
|
| 419 | $column->constrainName = $constraint['conname']; |
|
| @@ 208-216 (lines=9) @@ | ||
| 205 | $matches |
|
| 206 | )) { |
|
| 207 | $enumValues = explode(',', $matches[1]); |
|
| 208 | foreach ($enumValues as &$value) { |
|
| 209 | //Trimming values |
|
| 210 | if (preg_match("/^'?(.*?)'?$/", trim($value), $matches)) { |
|
| 211 | //In database: 'value' |
|
| 212 | $value = $matches[1]; |
|
| 213 | } |
|
| 214 | ||
| 215 | unset($value); |
|
| 216 | } |
|
| 217 | ||
| 218 | $column->enumValues = $enumValues; |
|
| 219 | } |
|