| @@ 371-383 (lines=13) @@ | ||
| 368 | $options['unique'] = ('true' === (string) $attributes['unique']); |
|
| 369 | } |
|
| 370 | ||
| 371 | if (isset($xmlIndex->{'option'})) { |
|
| 372 | foreach ($xmlIndex->{'option'} as $option) { |
|
| 373 | $value = (string) $option['value']; |
|
| 374 | if ($value === 'true') { |
|
| 375 | $value = true; |
|
| 376 | } elseif ($value === 'false') { |
|
| 377 | $value = false; |
|
| 378 | } elseif (is_numeric($value)) { |
|
| 379 | $value = preg_match('/^[-]?\d+$/', $value) ? (integer) $value : (float) $value; |
|
| 380 | } |
|
| 381 | $options[(string) $option['name']] = $value; |
|
| 382 | } |
|
| 383 | } |
|
| 384 | ||
| 385 | if (isset($xmlIndex->{'partial-filter-expression'})) { |
|
| 386 | $partialFilterExpressionMapping = $xmlIndex->{'partial-filter-expression'}; |
|
| @@ 466-478 (lines=13) @@ | ||
| 463 | $options['numInitialChunks'] = (int) $attributes['numInitialChunks']; |
|
| 464 | } |
|
| 465 | ||
| 466 | if (isset($xmlShardkey->{'option'})) { |
|
| 467 | foreach ($xmlShardkey->{'option'} as $option) { |
|
| 468 | $value = (string) $option['value']; |
|
| 469 | if ($value === 'true') { |
|
| 470 | $value = true; |
|
| 471 | } elseif ($value === 'false') { |
|
| 472 | $value = false; |
|
| 473 | } elseif (is_numeric($value)) { |
|
| 474 | $value = preg_match('/^[-]?\d+$/', $value) ? (integer) $value : (float) $value; |
|
| 475 | } |
|
| 476 | $options[(string) $option['name']] = $value; |
|
| 477 | } |
|
| 478 | } |
|
| 479 | ||
| 480 | $class->setShardKey($keys, $options); |
|
| 481 | } |
|