@@ 389-401 (lines=13) @@ | ||
386 | $options['unique'] = ('true' === (string) $attributes['unique']); |
|
387 | } |
|
388 | ||
389 | if (isset($xmlIndex->{'option'})) { |
|
390 | foreach ($xmlIndex->{'option'} as $option) { |
|
391 | $value = (string) $option['value']; |
|
392 | if ($value === 'true') { |
|
393 | $value = true; |
|
394 | } elseif ($value === 'false') { |
|
395 | $value = false; |
|
396 | } elseif (is_numeric($value)) { |
|
397 | $value = preg_match('/^[-]?\d+$/', $value) ? (integer) $value : (float) $value; |
|
398 | } |
|
399 | $options[(string) $option['name']] = $value; |
|
400 | } |
|
401 | } |
|
402 | ||
403 | if (isset($xmlIndex->{'partial-filter-expression'})) { |
|
404 | $partialFilterExpressionMapping = $xmlIndex->{'partial-filter-expression'}; |
|
@@ 484-496 (lines=13) @@ | ||
481 | $options['numInitialChunks'] = (int) $attributes['numInitialChunks']; |
|
482 | } |
|
483 | ||
484 | if (isset($xmlShardkey->{'option'})) { |
|
485 | foreach ($xmlShardkey->{'option'} as $option) { |
|
486 | $value = (string) $option['value']; |
|
487 | if ($value === 'true') { |
|
488 | $value = true; |
|
489 | } elseif ($value === 'false') { |
|
490 | $value = false; |
|
491 | } elseif (is_numeric($value)) { |
|
492 | $value = preg_match('/^[-]?\d+$/', $value) ? (integer) $value : (float) $value; |
|
493 | } |
|
494 | $options[(string) $option['name']] = $value; |
|
495 | } |
|
496 | } |
|
497 | ||
498 | $class->setShardKey($keys, $options); |
|
499 | } |