| @@ 210-216 (lines=7) @@ | ||
| 207 | $options = $mapping['index']; |
|
| 208 | } |
|
| 209 | ||
| 210 | if (isset($mapping['unique'])) { |
|
| 211 | if (is_array($mapping['unique'])) { |
|
| 212 | $options = $mapping['unique'] + array('unique' => true); |
|
| 213 | } else { |
|
| 214 | $unique = (boolean) $mapping['unique']; |
|
| 215 | } |
|
| 216 | } |
|
| 217 | ||
| 218 | if (isset($mapping['sparse'])) { |
|
| 219 | if (is_array($mapping['sparse'])) { |
|
| @@ 218-224 (lines=7) @@ | ||
| 215 | } |
|
| 216 | } |
|
| 217 | ||
| 218 | if (isset($mapping['sparse'])) { |
|
| 219 | if (is_array($mapping['sparse'])) { |
|
| 220 | $options = $mapping['sparse'] + array('sparse' => true); |
|
| 221 | } else { |
|
| 222 | $sparse = (boolean) $mapping['sparse']; |
|
| 223 | } |
|
| 224 | } |
|
| 225 | ||
| 226 | if (isset($unique)) { |
|
| 227 | $options['unique'] = $unique; |
|