PHP 클래스 Doctrine\ODM\MongoDB\SchemaManager

파일 보기 프로젝트 열기: doctrine/mongodb-odm 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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