@@ 266-273 (lines=8) @@ | ||
263 | * @param string $documentName |
|
264 | * @throws \InvalidArgumentException |
|
265 | */ |
|
266 | public function deleteDocumentIndexes($documentName) |
|
267 | { |
|
268 | $class = $this->dm->getClassMetadata($documentName); |
|
269 | if ($class->isMappedSuperclass || $class->isEmbeddedDocument || $class->isQueryResultDocument) { |
|
270 | throw new \InvalidArgumentException('Cannot delete document indexes for mapped super classes, embedded documents or query result documents.'); |
|
271 | } |
|
272 | $this->dm->getDocumentCollection($documentName)->dropIndexes(); |
|
273 | } |
|
274 | ||
275 | /** |
|
276 | * Create all the mapped document collections in the metadata factory. |
|
@@ 331-338 (lines=8) @@ | ||
328 | * @param string $documentName |
|
329 | * @throws \InvalidArgumentException |
|
330 | */ |
|
331 | public function dropDocumentCollection($documentName) |
|
332 | { |
|
333 | $class = $this->dm->getClassMetadata($documentName); |
|
334 | if ($class->isMappedSuperclass || $class->isEmbeddedDocument || $class->isQueryResultDocument) { |
|
335 | throw new \InvalidArgumentException('Cannot delete document indexes for mapped super classes, embedded documents or query result documents.'); |
|
336 | } |
|
337 | $this->dm->getDocumentCollection($documentName)->drop(); |
|
338 | } |
|
339 | ||
340 | /** |
|
341 | * Drop all the mapped document databases in the metadata factory. |
|
@@ 359-366 (lines=8) @@ | ||
356 | * @param string $documentName |
|
357 | * @throws \InvalidArgumentException |
|
358 | */ |
|
359 | public function dropDocumentDatabase($documentName) |
|
360 | { |
|
361 | $class = $this->dm->getClassMetadata($documentName); |
|
362 | if ($class->isMappedSuperclass || $class->isEmbeddedDocument || $class->isQueryResultDocument) { |
|
363 | throw new \InvalidArgumentException('Cannot drop document database for mapped super classes, embedded documents or query result documents.'); |
|
364 | } |
|
365 | $this->dm->getDocumentDatabase($documentName)->drop(); |
|
366 | } |
|
367 | ||
368 | /** |
|
369 | * Determine if an index returned by MongoCollection::getIndexInfo() can be |