PHP Класс Doctrine\ODM\MongoDB\SchemaManager

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$dm DocumentManager
$metadataFactory Doctrine\ODM\MongoDB\Mapping\ClassMetadataFactory

Открытые методы

Метод Описание
__construct ( DocumentManager $dm, ClassMetadataFactory $cmf )
createCollections ( ) Create all the mapped document collections in the metadata factory.
createDatabases ( ) Create all the mapped document databases in the metadata factory.
createDocumentCollection ( string $documentName ) Create the document collection for a mapped class.
createDocumentDatabase ( string $documentName ) Create the document database for a mapped class.
deleteDocumentIndexes ( string $documentName ) Delete the given document's indexes.
deleteIndexes ( ) Delete indexes for all documents that can be loaded with the metadata factory.
dropCollections ( ) Drop all the mapped document collections in the metadata factory.
dropDatabases ( ) Drop all the mapped document databases in the metadata factory.
dropDocumentCollection ( string $documentName ) Drop the document collection for a mapped class.
dropDocumentDatabase ( string $documentName ) Drop the document database for a mapped class.
enableShardingForDbByDocumentName ( string $documentName ) Enable sharding for database which contains documents with given name.
ensureDocumentIndexes ( string $documentName, integer $timeout = null ) Ensure the given document's indexes are created.
ensureDocumentSharding ( string $documentName, array $indexOptions = [] ) Ensure sharding for collection by document name.
ensureIndexes ( integer $timeout = null ) Ensure indexes are created for all documents that can be loaded with the metadata factory.
ensureSharding ( array $indexOptions = [] ) Ensure collections are sharded for all documents that can be loaded with the metadata factory.
getDocumentIndexes ( string $documentName ) : array
isMongoIndexEquivalentToDocumentIndex ( array $mongoIndex, array $documentIndex ) : boolean Determine if an index returned by MongoCollection::getIndexInfo() can be considered equivalent to an index in class metadata.
updateDocumentIndexes ( string $documentName, integer $timeout = null ) Ensure indexes exist for the mapped document class.
updateIndexes ( integer $timeout = null ) Ensure indexes exist for all mapped document classes.

Приватные методы

Метод Описание
doGetDocumentIndexes ( string $documentName, array &$visited ) : array
prepareIndexes ( ClassMetadata $class ) : array
runShardCollectionCommand ( $documentName ) : array

Описание методов

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

public __construct ( DocumentManager $dm, ClassMetadataFactory $cmf )
$dm DocumentManager
$cmf Doctrine\ODM\MongoDB\Mapping\ClassMetadataFactory

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

Create all the mapped document collections in the metadata factory.
public createCollections ( )

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

Create all the mapped document databases in the metadata factory.
Устаревший: Databases are created automatically by MongoDB (>= 3.0). Deprecated since ODM 1.2, to be removed in ODM 2.0.
public createDatabases ( )

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

Create the document collection for a mapped class.
public createDocumentCollection ( string $documentName )
$documentName string

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

Create the document database for a mapped class.
Устаревший: A database is created automatically by MongoDB (>= 3.0). Deprecated since ODM 1.2, to be removed in ODM 2.0.
public createDocumentDatabase ( string $documentName )
$documentName string

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

Delete the given document's indexes.
public deleteDocumentIndexes ( string $documentName )
$documentName string

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

Delete indexes for all documents that can be loaded with the metadata factory.
public deleteIndexes ( )

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

Drop all the mapped document collections in the metadata factory.
public dropCollections ( )

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

Drop all the mapped document databases in the metadata factory.
public dropDatabases ( )

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

Drop the document collection for a mapped class.
public dropDocumentCollection ( string $documentName )
$documentName string

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

Drop the document database for a mapped class.
public dropDocumentDatabase ( string $documentName )
$documentName string

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

Enable sharding for database which contains documents with given name.
public enableShardingForDbByDocumentName ( string $documentName )
$documentName string

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

Ensure the given document's indexes are created.
public ensureDocumentIndexes ( string $documentName, integer $timeout = null )
$documentName string
$timeout integer Timeout (ms) for acknowledged index creation

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

Ensure sharding for collection by document name.
public ensureDocumentSharding ( string $documentName, array $indexOptions = [] )
$documentName string
$indexOptions array Options for `ensureIndex` command. It's performed on an existing collections.

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

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

Ensure collections are sharded for all documents that can be loaded with the metadata factory.
public ensureSharding ( array $indexOptions = [] )
$indexOptions array Options for `ensureIndex` command. It's performed on an existing collections

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

public getDocumentIndexes ( string $documentName ) : array
$documentName string
Результат array

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

Indexes are considered different if: (a) Key/direction pairs differ or are not in the same order (b) Sparse or unique options differ (c) Mongo index is unique without dropDups and mapped index is unique with dropDups (d) Geospatial options differ (bits, max, min) (e) The partialFilterExpression differs Regarding (c), the inverse case is not a reason to delete and recreate the index, since dropDups only affects creation of the unique index. Additionally, the background option is only relevant to index creation and is not considered.
public isMongoIndexEquivalentToDocumentIndex ( array $mongoIndex, array $documentIndex ) : boolean
$mongoIndex array Mongo index data.
$documentIndex array Document index data.
Результат boolean True if the indexes are equivalent, otherwise false.

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

Indexes that exist in MongoDB but not the document metadata will be deleted.
public updateDocumentIndexes ( string $documentName, integer $timeout = null )
$documentName string
$timeout integer Timeout (ms) for acknowledged index creation

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

Indexes that exist in MongoDB but not the document metadata will be deleted.
public updateIndexes ( integer $timeout = null )
$timeout integer Timeout (ms) for acknowledged index creation

Описание свойств

$dm защищенное свойство

protected DocumentManager,Doctrine\ODM\MongoDB $dm
Результат DocumentManager

$metadataFactory защищенное свойство

protected ClassMetadataFactory,Doctrine\ODM\MongoDB\Mapping $metadataFactory
Результат Doctrine\ODM\MongoDB\Mapping\ClassMetadataFactory