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