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