Doctrine\ODM\MongoDB\SchemaManager::createCollections PHP Method

createCollections() public method

Create all the mapped document collections in the metadata factory.
public createCollections ( )
    public function createCollections()
    {
        foreach ($this->metadataFactory->getAllMetadata() as $class) {
            if ($class->isMappedSuperclass || $class->isEmbeddedDocument || $class->isQueryResultDocument) {
                continue;
            }
            $this->createDocumentCollection($class->name);
        }
    }

Usage Example

 /**
  * @param SchemaManager $schemaManager
  */
 protected function createSchema(SchemaManager $schemaManager)
 {
     $schemaManager->createCollections();
 }
All Usage Examples Of Doctrine\ODM\MongoDB\SchemaManager::createCollections