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