| @@ 397-409 (lines=13) @@ | ||
| 394 | $options['unique'] = ('true' === (string) $attributes['unique']); |
|
| 395 | } |
|
| 396 | ||
| 397 | if (isset($xmlIndex->{'option'})) { |
|
| 398 | foreach ($xmlIndex->{'option'} as $option) { |
|
| 399 | $value = (string) $option['value']; |
|
| 400 | if ($value === 'true') { |
|
| 401 | $value = true; |
|
| 402 | } elseif ($value === 'false') { |
|
| 403 | $value = false; |
|
| 404 | } elseif (is_numeric($value)) { |
|
| 405 | $value = preg_match('/^[-]?\d+$/', $value) ? (integer) $value : (float) $value; |
|
| 406 | } |
|
| 407 | $options[(string) $option['name']] = $value; |
|
| 408 | } |
|
| 409 | } |
|
| 410 | ||
| 411 | if (isset($xmlIndex->{'partial-filter-expression'})) { |
|
| 412 | $partialFilterExpressionMapping = $xmlIndex->{'partial-filter-expression'}; |
|
| @@ 492-504 (lines=13) @@ | ||
| 489 | $options['numInitialChunks'] = (int) $attributes['numInitialChunks']; |
|
| 490 | } |
|
| 491 | ||
| 492 | if (isset($xmlShardkey->{'option'})) { |
|
| 493 | foreach ($xmlShardkey->{'option'} as $option) { |
|
| 494 | $value = (string) $option['value']; |
|
| 495 | if ($value === 'true') { |
|
| 496 | $value = true; |
|
| 497 | } elseif ($value === 'false') { |
|
| 498 | $value = false; |
|
| 499 | } elseif (is_numeric($value)) { |
|
| 500 | $value = preg_match('/^[-]?\d+$/', $value) ? (integer) $value : (float) $value; |
|
| 501 | } |
|
| 502 | $options[(string) $option['name']] = $value; |
|
| 503 | } |
|
| 504 | } |
|
| 505 | ||
| 506 | $class->setShardKey($keys, $options); |
|
| 507 | } |
|