| @@ 358-370 (lines=13) @@ | ||
| 355 | $options['unique'] = ('true' === (string) $attributes['unique']); |
|
| 356 | } |
|
| 357 | ||
| 358 | if (isset($xmlIndex->{'option'})) { |
|
| 359 | foreach ($xmlIndex->{'option'} as $option) { |
|
| 360 | $value = (string) $option['value']; |
|
| 361 | if ($value === 'true') { |
|
| 362 | $value = true; |
|
| 363 | } elseif ($value === 'false') { |
|
| 364 | $value = false; |
|
| 365 | } elseif (is_numeric($value)) { |
|
| 366 | $value = preg_match('/^[-]?\d+$/', $value) ? (integer) $value : (float) $value; |
|
| 367 | } |
|
| 368 | $options[(string) $option['name']] = $value; |
|
| 369 | } |
|
| 370 | } |
|
| 371 | ||
| 372 | if (isset($xmlIndex->{'partial-filter-expression'})) { |
|
| 373 | $partialFilterExpressionMapping = $xmlIndex->{'partial-filter-expression'}; |
|
| @@ 453-465 (lines=13) @@ | ||
| 450 | $options['numInitialChunks'] = (int) $attributes['numInitialChunks']; |
|
| 451 | } |
|
| 452 | ||
| 453 | if (isset($xmlShardkey->{'option'})) { |
|
| 454 | foreach ($xmlShardkey->{'option'} as $option) { |
|
| 455 | $value = (string) $option['value']; |
|
| 456 | if ($value === 'true') { |
|
| 457 | $value = true; |
|
| 458 | } elseif ($value === 'false') { |
|
| 459 | $value = false; |
|
| 460 | } elseif (is_numeric($value)) { |
|
| 461 | $value = preg_match('/^[-]?\d+$/', $value) ? (integer) $value : (float) $value; |
|
| 462 | } |
|
| 463 | $options[(string) $option['name']] = $value; |
|
| 464 | } |
|
| 465 | } |
|
| 466 | ||
| 467 | $class->setShardKey($keys, $options); |
|
| 468 | } |
|