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