PHP Class Doctrine\ODM\MongoDB\SchemaManager

Afficher le fichier Open project: doctrine/mongodb-odm Class Usage Examples

Protected Properties

Свойство Type Description
$dm DocumentManager
$metadataFactory Doctrine\ODM\MongoDB\Mapping\ClassMetadataFactory

Méthodes publiques

Méthode Description
__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.

Private Methods

Méthode Description
doGetDocumentIndexes ( string $documentName, array &$visited ) : array
prepareIndexes ( ClassMetadata $class ) : array
runShardCollectionCommand ( $documentName ) : array

Method Details

__construct() public méthode

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

createCollections() public méthode

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

createDatabases() public méthode

Create all the mapped document databases in the metadata factory.
Deprecation: Databases are created automatically by MongoDB (>= 3.0). Deprecated since ODM 1.2, to be removed in ODM 2.0.
public createDatabases ( )

createDocumentCollection() public méthode

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

createDocumentDatabase() public méthode

Create the document database for a mapped class.
Deprecation: 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() public méthode

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

deleteIndexes() public méthode

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

dropCollections() public méthode

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

dropDatabases() public méthode

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

dropDocumentCollection() public méthode

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

dropDocumentDatabase() public méthode

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

enableShardingForDbByDocumentName() public méthode

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

ensureDocumentIndexes() public méthode

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() public méthode

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() public méthode

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() public méthode

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 méthode

public getDocumentIndexes ( string $documentName ) : array
$documentName string
Résultat array

isMongoIndexEquivalentToDocumentIndex() public méthode

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.
Résultat boolean True if the indexes are equivalent, otherwise false.

updateDocumentIndexes() public méthode

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() public méthode

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

Property Details

$dm protected_oe property

protected DocumentManager,Doctrine\ODM\MongoDB $dm
Résultat DocumentManager

$metadataFactory protected_oe property

protected ClassMetadataFactory,Doctrine\ODM\MongoDB\Mapping $metadataFactory
Résultat Doctrine\ODM\MongoDB\Mapping\ClassMetadataFactory