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