@@ 300-307 (lines=8) @@ | ||
297 | * @param string $documentName |
|
298 | * @throws \InvalidArgumentException |
|
299 | */ |
|
300 | public function deleteDocumentIndexes($documentName) |
|
301 | { |
|
302 | $class = $this->dm->getClassMetadata($documentName); |
|
303 | if ($class->isMappedSuperclass || $class->isEmbeddedDocument) { |
|
304 | throw new \InvalidArgumentException('Cannot delete document indexes for mapped super classes or embedded documents.'); |
|
305 | } |
|
306 | $this->dm->getDocumentCollection($documentName)->deleteIndexes(); |
|
307 | } |
|
308 | ||
309 | /** |
|
310 | * Create all the mapped document collections in the metadata factory. |
|
@@ 398-405 (lines=8) @@ | ||
395 | * @param string $documentName |
|
396 | * @throws \InvalidArgumentException |
|
397 | */ |
|
398 | public function dropDocumentDatabase($documentName) |
|
399 | { |
|
400 | $class = $this->dm->getClassMetadata($documentName); |
|
401 | if ($class->isMappedSuperclass || $class->isEmbeddedDocument) { |
|
402 | throw new \InvalidArgumentException('Cannot drop document database for mapped super classes or embedded documents.'); |
|
403 | } |
|
404 | $this->dm->getDocumentDatabase($documentName)->drop(); |
|
405 | } |
|
406 | ||
407 | /** |
|
408 | * Create all the mapped document databases in the metadata factory. |
|
@@ 426-433 (lines=8) @@ | ||
423 | * @param string $documentName |
|
424 | * @throws \InvalidArgumentException |
|
425 | */ |
|
426 | public function createDocumentDatabase($documentName) |
|
427 | { |
|
428 | $class = $this->dm->getClassMetadata($documentName); |
|
429 | if ($class->isMappedSuperclass || $class->isEmbeddedDocument) { |
|
430 | throw new \InvalidArgumentException('Cannot delete document indexes for mapped super classes or embedded documents.'); |
|
431 | } |
|
432 | $this->dm->getDocumentDatabase($documentName)->execute("function() { return true; }"); |
|
433 | } |
|
434 | ||
435 | /** |
|
436 | * Determine if an index returned by MongoCollection::getIndexInfo() can be |