Doctrine\ODM\MongoDB\SchemaManager::ensureIndexes PHP Метод

ensureIndexes() публичный Метод

Ensure indexes are created for all documents that can be loaded with the metadata factory.
public ensureIndexes ( integer $timeout = null )
$timeout integer Timeout (ms) for acknowledged index creation
    public function ensureIndexes($timeout = null)
    {
        foreach ($this->metadataFactory->getAllMetadata() as $class) {
            if ($class->isMappedSuperclass || $class->isEmbeddedDocument || $class->isQueryResultDocument) {
                continue;
            }
            $this->ensureDocumentIndexes($class->name, $timeout);
        }
    }

Usage Example

 protected function processIndex(SchemaManager $sm)
 {
     $sm->ensureIndexes();
 }
All Usage Examples Of Doctrine\ODM\MongoDB\SchemaManager::ensureIndexes