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