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