프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$alsoLoadMethods | array | READ-ONLY: Array of fields to also load with a given method. | |
$associationMappings | array | Keys are field names and values are mapping definitions. | |
$changeTrackingPolicy | integer | READ-ONLY: The policy used for change-tracking on entities of this class. | |
$collection | READ-ONLY: The name of the mongo collection the document is mapped to. | ||
$collectionCapped | READ-ONLY: If the collection should be a fixed size. | ||
$collectionMax | READ-ONLY: If the collection is fixed size, the maximum number of elements to store in the collection. | ||
$collectionSize | READ-ONLY: If the collection is fixed size, its size in bytes. | ||
$customRepositoryClassName | string | (Optional). | |
$db | READ-ONLY: The name of the mongo database the document is mapped to. | ||
$defaultDiscriminatorValue | string | READ-ONLY: The default value for discriminatorField in case it's not set in the document | |
$discriminatorField | string | READ-ONLY: The definition of the discriminator field used in SINGLE_COLLECTION inheritance mapping. | |
$discriminatorMap | mixed | This does only apply to the SINGLE_COLLECTION inheritance mapping strategy where a discriminator field is used. | |
$discriminatorValue | mixed | This does only apply to the JOINED and SINGLE_COLLECTION inheritance mapping strategies where a discriminator field is used. | |
$distance | READ-ONLY: The field that stores the calculated distance when performing geo spatial queries. | ||
$fieldMappings | array | Keys are field names and values are mapping definitions. The mapping definition array has the following values: - fieldName (string) The name of the field in the Document. - id (boolean, optional) Marks the field as the primary key of the document. Multiple fields of an document can have the id attribute, forming a composite key. | |
$file | READ-ONLY: The field that stores a file reference and indicates the document is a file and should be stored on the MongoGridFS. | ||
$generatorOptions | array | READ-ONLY: The Id generator options. | |
$generatorType | string | READ-ONLY: The Id generator type used by the class. | |
$idGenerator | READ-ONLY: The ID generator used for generating IDs for this class. | ||
$identifier | READ-ONLY: The field name of the document identifier. | ||
$indexes | READ-ONLY: The array of indexes for the document collection. | ||
$inheritanceType | integer | READ-ONLY: The inheritance mapping type used by the class. | |
$isEmbeddedDocument | boolean | READ-ONLY: Whether this class describes the mapping of a embedded document. | |
$isLockable | boolean | READ-ONLY: A flag for whether or not instances of this class are to allow pessimistic locking. | |
$isMappedSuperclass | boolean | READ-ONLY: Whether this class describes the mapping of a mapped superclass. | |
$isQueryResultDocument | boolean | READ-ONLY: Whether this class describes the mapping of an aggregation result document. | |
$isVersioned | boolean | READ-ONLY: A flag for whether or not instances of this class are to be versioned with optimistic locking. | |
$lifecycleCallbacks | array | READ-ONLY: The registered lifecycle callbacks for documents of this class. | |
$lockField | mixed | READ-ONLY: The name of the field which is used for locking a document. | |
$name | READ-ONLY: The name of the document class. | ||
$namespace | string | READ-ONLY: The namespace the document class is contained in. | |
$parentClasses | array | READ-ONLY: The names of the parent classes (ancestors). | |
$reflClass | ReflectionClass | The ReflectionClass instance of the mapped class. | |
$reflFields | ReflectionProperty[] | The ReflectionProperty instances of the mapped class. | |
$requireIndexes | READ-ONLY: Whether or not queries on this document should require indexes. | ||
$rootDocumentName | string | READ-ONLY: The name of the document class that is at the root of the mapped document inheritance hierarchy. If the document is not part of a mapped inheritance hierarchy this is the same as {@link $documentName}. | |
$shardKey | READ-ONLY: Keys and options describing shard key. Only for sharded collections. | ||
$slaveOkay | READ-ONLY: Whether or not reads for this class are okay to read from a slave. | ||
$subClasses | array | READ-ONLY: The names of all subclasses (descendants). | |
$versionField | mixed | READ-ONLY: The name of the field which is used for versioning in optimistic locking (if any). | |
$writeConcern | READ-ONLY: Describes the level of acknowledgement requested from MongoDB for write operations. |
메소드 | 설명 | |
---|---|---|
__construct ( string $documentName ) | Initializes a new ClassMetadata instance that will hold the object-document mapping metadata of the class with the given name. | |
addIndex ( array $keys, array $options = [] ) | Add a index for this Document. | |
addInheritedAssociationMapping ( array $mapping ) : void | INTERNAL: Adds an association mapping without completing/validating it. | |
addInheritedFieldMapping ( array $fieldMapping ) | INTERNAL: Adds a field mapping without completing/validating it. | |
addLifecycleCallback ( string $callback, string $event ) | Adds a lifecycle callback for documents of this class. | |
getAssociationCollectionClass ( string $assocName ) | Retrieve the collectionClass associated with an association | |
getAssociationMappedByTargetField ( $fieldName ) | {@inheritDoc} | |
getAssociationNames ( ) | {@inheritDoc} | |
getAssociationTargetClass ( $assocName ) | {@inheritDoc} | |
getCollection ( ) : string | Get the collection this Document is mapped to. | |
getCollectionCapped ( ) : boolean | Get whether or not the documents collection is capped. | |
getCollectionMax ( ) : integer | Get the collection max. | |
getCollectionSize ( ) : integer | Get the collection size | |
getDatabase ( ) : string | Returns the database this Document is mapped to. | |
getDatabaseIdentifierValue ( mixed $id ) : mixed | Casts the identifier to its database type. | |
getDistance ( ) : string | Returns the distance field name. | |
getEmbeddedFieldsMappings ( ) : array | Gets mappings of fields holding embedded document(s). | |
getFieldMapping ( string $fieldName ) : array | Gets the mapping of a field. | |
getFieldMappingByDbFieldName ( string $dbFieldName ) : array | Gets the field mapping by its DB name. | |
getFieldNames ( ) | {@inheritDoc} | |
getFieldValue ( object $document, string $field ) : mixed | Gets the specified field's value off the given document. | |
getFile ( ) : string | Returns the file field name. | |
getIdentifier ( ) | {@inheritDoc} | |
getIdentifierFieldNames ( ) | {@inheritDoc} | |
getIdentifierObject ( object $document ) : MongoId | Get the document identifier object as a database type. | |
getIdentifierValue ( object $document ) : mixed | Gets the document identifier as a PHP type. | |
getIdentifierValues ( $object ) | {@inheritDoc} | |
getIndexes ( ) : array | Returns the array of indexes for this Document. | |
getLifecycleCallbacks ( string $event ) : array | Gets the registered lifecycle callbacks for an event. | |
getName ( ) | {@inheritDoc} | |
getNamespace ( ) : string | The namespace this Document class belongs to. | |
getPHPIdentifierValue ( mixed $id ) : mixed | Casts the identifier to its portable PHP type. | |
getReflectionClass ( ) | {@inheritDoc} | |
getReflectionProperties ( ) : array | Gets the ReflectionProperties of the mapped class. | |
getReflectionProperty ( string $name ) : ReflectionProperty | Gets a ReflectionProperty for a specific field of the mapped class. | |
getShardKey ( ) : array | ||
getTypeOfField ( $fieldName ) | {@inheritDoc} | |
getWriteConcern ( ) : string | ||
hasAssociation ( $fieldName ) | {@inheritDoc} | |
hasDiscriminator ( ) : boolean | Checks whether the document has a discriminator field and value configured. | |
hasEmbed ( string $fieldName ) : boolean | Checks whether the class has a mapped embed with the given field name. | |
hasField ( $fieldName ) | {@inheritDoc} | |
hasIndexes ( ) : boolean | Checks whether this document has indexes or not. | |
hasLifecycleCallbacks ( string $event ) : boolean | Checks whether the class has callbacks registered for a lifecycle event. | |
hasReference ( string $fieldName ) : boolean | Checks whether the class has a mapped association with the given field name. | |
hasWriteConcern ( ) : boolean | Whether there is a write concern configured for this class. | |
invokeLifecycleCallbacks ( string $event, object $document, array $arguments = null ) | Dispatches the lifecycle event of the given document by invoking all registered callbacks. | |
isAssociationInverseSide ( $fieldName ) | {@inheritDoc} | |
isChangeTrackingDeferredExplicit ( ) : boolean | Whether the change tracking policy of this class is "deferred explicit". | |
isChangeTrackingDeferredImplicit ( ) : boolean | Whether the change tracking policy of this class is "deferred implicit". | |
isChangeTrackingNotify ( ) : boolean | Whether the change tracking policy of this class is "notify". | |
isCollectionValuedAssociation ( $fieldName ) | {@inheritDoc} | |
isCollectionValuedEmbed ( string $fieldName ) : boolean | Checks whether the class has a mapped embedded document for the specified field and if yes, checks whether it is a collection-valued association (to-many). | |
isCollectionValuedReference ( string $fieldName ) : boolean | Checks whether the class has a mapped association for the specified field and if yes, checks whether it is a collection-valued association (to-many). | |
isFile ( ) : boolean | Returns TRUE if this Document is a file to be stored on the MongoGridFS FALSE otherwise. | |
isIdGeneratorAuto ( ) : boolean | Checks whether the class will generate a new \MongoId instance for us. | |
isIdGeneratorIncrement ( ) : boolean | Checks whether the class will use a collection to generate incremented identifiers. | |
isIdGeneratorNone ( ) : boolean | Checks whether the class uses no id generator. | |
isIdGeneratorUuid ( ) : boolean | Checks whether the class will generate a uuid id. | |
isIdentifier ( $fieldName ) | {@inheritDoc} | |
isInheritanceTypeCollectionPerClass ( ) : boolean | Checks whether the mapped class uses the COLLECTION_PER_CLASS inheritance mapping strategy. | |
isInheritanceTypeNone ( ) : boolean | ||
isInheritanceTypeSingleCollection ( ) : boolean | Checks whether the mapped class uses the SINGLE_COLLECTION inheritance mapping strategy. | |
isInheritedField ( string $fieldName ) : boolean | Checks whether a mapped field is inherited from an entity superclass. | |
isMappedToCollection ( ) : boolean | Returns TRUE if this Document is mapped to a collection FALSE otherwise. | |
isNullable ( string $fieldName ) : boolean | Check if the field is not null. | |
isSharded ( ) : boolean | Checks whether this document has shard key or not. | |
isSingleValuedAssociation ( $fieldName ) | {@inheritDoc} | |
isSingleValuedEmbed ( string $fieldName ) : boolean | Checks whether the class has a mapped embedded document for the specified field and if yes, checks whether it is a single-valued association (to-one). | |
isSingleValuedReference ( string $fieldName ) : boolean | Checks whether the class has a mapped association for the specified field and if yes, checks whether it is a single-valued association (to-one). | |
mapField ( array $mapping ) : array | Map a field. | |
mapFile ( array $mapping ) | Map a MongoGridFSFile. | |
mapManyEmbedded ( array $mapping ) | Map a collection of embedded documents. | |
mapManyReference ( array $mapping ) | Map a collection of document references. | |
mapOneEmbedded ( array $mapping ) | Map a single embedded document. | |
mapOneReference ( array $mapping ) | Map a single document reference. | |
registerAlsoLoadMethod ( string $method, array | string $fields ) | Registers a method for loading document data before field hydration. | |
setAlsoLoadMethods ( array $methods ) | Sets the AlsoLoad methods for documents of this class. | |
setChangeTrackingPolicy ( integer $policy ) | Sets the change tracking policy used by this class. | |
setCollection ( array | string $name ) | Sets the collection this Document is mapped to. | |
setCollectionCapped ( boolean $bool ) | Set whether or not the documents collection is capped. | |
setCollectionMax ( integer $max ) | Set the collection max. | |
setCollectionSize ( integer $size ) | Set the collection size. | |
setCustomRepositoryClass ( string $repositoryClassName ) | Registers a custom repository class for the document class. | |
setDatabase ( string $db ) | Set the database this Document is mapped to. | |
setDefaultDiscriminatorValue ( string $defaultDiscriminatorValue ) | Sets the default discriminator value to be used for this class Used for JOINED and SINGLE_TABLE inheritance mapping strategies if the document has no discriminator value | |
setDiscriminatorField ( string $discriminatorField ) | Sets the discriminator field. | |
setDiscriminatorMap ( array $map ) | Sets the discriminator values used by this class. | |
setDiscriminatorValue ( string $value ) | Sets the discriminator value for this class. | |
setDistance ( string $distance ) | Set the field name that stores the distance. | |
setFieldValue ( object $document, string $field, mixed $value ) | Sets the specified field to the specified value on the given document. | |
setFile ( string $file ) | Set the field name that stores the grid file. | |
setIdGenerator ( |
Sets the ID generator used to generate IDs for instances of this class. | |
setIdGeneratorOptions ( array $generatorOptions ) | Sets the Id generator options. | |
setIdGeneratorType ( string $generatorType ) | Sets the type of Id generator to use for the mapped class. | |
setIdentifier ( string $identifier ) | INTERNAL: Sets the mapped identifier field of this class. | |
setIdentifierValue ( object $document, mixed $id ) | Sets the document identifier of a document. | |
setInheritanceType ( integer $type ) | Sets the inheritance type used by the class and it's subclasses. | |
setLifecycleCallbacks ( array $callbacks ) | Sets the lifecycle callbacks for documents of this class. | |
setLockField ( string $lockField ) | Sets the name of the field that is to be used for storing whether a document is currently locked or not. | |
setLockMapping ( array &$mapping ) | Sets the version field mapping used for versioning. Sets the default value to use depending on the column type. | |
setLockable ( boolean $bool ) | Sets whether this class is to allow pessimistic locking. | |
setParentClasses ( array $classNames ) | Sets the parent class names. | |
setRequireIndexes ( boolean $requireIndexes ) | Set whether or not queries on this document should require indexes. | |
setShardKey ( array $keys, array $options = [] ) | Set shard key for this Document. | |
setSlaveOkay ( boolean | null $slaveOkay ) | Sets the slaveOkay option applied to collections for this class. | |
setSubclasses ( array $subclasses ) | Sets the mapped subclasses of this class. | |
setVersionField ( string $versionField ) | Sets the name of the field that is to be used for versioning if this class is versioned for optimistic locking. | |
setVersionMapping ( array &$mapping ) | Sets the version field mapping used for versioning. Sets the default value to use depending on the column type. | |
setVersioned ( boolean $bool ) | Sets whether this class is to be versioned for optimistic locking. | |
setWriteConcern ( string $writeConcern ) | Sets the write concern used by this class. |
메소드 | 설명 | |
---|---|---|
applyStorageStrategy ( array &$mapping ) | Validates the storage strategy of a mapping for consistency |
public __construct ( string $documentName ) | ||
$documentName | string | The name of the document class the new instance is used for. |
public addInheritedAssociationMapping ( array $mapping ) : void | ||
$mapping | array | |
리턴 | void |
public addInheritedFieldMapping ( array $fieldMapping ) | ||
$fieldMapping | array |
public addLifecycleCallback ( string $callback, string $event ) | ||
$callback | string | |
$event | string |
public getAssociationCollectionClass ( string $assocName ) | ||
$assocName | string |
public getAssociationMappedByTargetField ( $fieldName ) |
public getCollection ( ) : string | ||
리턴 | string | $collection The collection name. |
public getCollectionCapped ( ) : boolean | ||
리턴 | boolean |
public getCollectionSize ( ) : integer | ||
리턴 | integer |
public getDatabase ( ) : string | ||
리턴 | string | $db The database name. |
public getDatabaseIdentifierValue ( mixed $id ) : mixed | ||
$id | mixed | |
리턴 | mixed | $id |
public getDistance ( ) : string | ||
리턴 | string | $distance The distance field name. |
public getEmbeddedFieldsMappings ( ) : array | ||
리턴 | array | of field mappings |
public getFieldMapping ( string $fieldName ) : array | ||
$fieldName | string | The field name. |
리턴 | array | The field mapping. |
public getFieldMappingByDbFieldName ( string $dbFieldName ) : array | ||
$dbFieldName | string | |
리턴 | array |
public getIdentifier ( ) |
public getIdentifierFieldNames ( ) |
public getIdentifierObject ( object $document ) : MongoId | ||
$document | object | |
리턴 | MongoId | $id The MongoID object. |
public getIdentifierValue ( object $document ) : mixed | ||
$document | object | |
리턴 | mixed | $id |
public getIdentifierValues ( $object ) |
public getIndexes ( ) : array | ||
리턴 | array | $indexes The array of indexes. |
public getLifecycleCallbacks ( string $event ) : array | ||
$event | string | |
리턴 | array |
public getNamespace ( ) : string | ||
리턴 | string | $namespace The namespace name. |
public getPHPIdentifierValue ( mixed $id ) : mixed | ||
$id | mixed | |
리턴 | mixed | $id |
public getReflectionProperties ( ) : array | ||
리턴 | array | An array of ReflectionProperty instances. |
public getReflectionProperty ( string $name ) : ReflectionProperty | ||
$name | string | |
리턴 | ReflectionProperty |
public hasAssociation ( $fieldName ) |
public hasDiscriminator ( ) : boolean | ||
리턴 | boolean |
public hasIndexes ( ) : boolean | ||
리턴 | boolean |
public hasLifecycleCallbacks ( string $event ) : boolean | ||
$event | string | Lifecycle event |
리턴 | boolean |
public hasReference ( string $fieldName ) : boolean | ||
$fieldName | string | |
리턴 | boolean |
public hasWriteConcern ( ) : boolean | ||
리턴 | boolean |
public isChangeTrackingDeferredExplicit ( ) : boolean | ||
리턴 | boolean |
public isChangeTrackingDeferredImplicit ( ) : boolean | ||
리턴 | boolean |
public isChangeTrackingNotify ( ) : boolean | ||
리턴 | boolean |
public isCollectionValuedAssociation ( $fieldName ) |
public isCollectionValuedEmbed ( string $fieldName ) : boolean | ||
$fieldName | string | |
리턴 | boolean | TRUE if the association exists and is collection-valued, FALSE otherwise. |
public isCollectionValuedReference ( string $fieldName ) : boolean | ||
$fieldName | string | |
리턴 | boolean | TRUE if the association exists and is collection-valued, FALSE otherwise. |
public isIdGeneratorAuto ( ) : boolean | ||
리턴 | boolean | TRUE if the class uses the AUTO generator, FALSE otherwise. |
public isIdGeneratorIncrement ( ) : boolean | ||
리턴 | boolean | TRUE if the class uses the INCREMENT generator, FALSE otherwise. |
public isIdGeneratorNone ( ) : boolean | ||
리턴 | boolean | TRUE if the class does not use any id generator, FALSE otherwise. |
public isIdGeneratorUuid ( ) : boolean | ||
리턴 | boolean | TRUE if the class uses the UUID generator, FALSE otherwise. |
public isInheritanceTypeCollectionPerClass ( ) : boolean | ||
리턴 | boolean |
public isInheritanceTypeSingleCollection ( ) : boolean | ||
리턴 | boolean |
public isInheritedField ( string $fieldName ) : boolean | ||
$fieldName | string | |
리턴 | boolean | TRUE if the field is inherited, FALSE otherwise. |
public isMappedToCollection ( ) : boolean | ||
리턴 | boolean |
public isNullable ( string $fieldName ) : boolean | ||
$fieldName | string | The field name |
리턴 | boolean | TRUE if the field is not null, FALSE otherwise. |
public isSingleValuedAssociation ( $fieldName ) |
public isSingleValuedEmbed ( string $fieldName ) : boolean | ||
$fieldName | string | |
리턴 | boolean | TRUE if the association exists and is single-valued, FALSE otherwise. |
public isSingleValuedReference ( string $fieldName ) : boolean | ||
$fieldName | string | |
리턴 | boolean | TRUE if the association exists and is single-valued, FALSE otherwise. |
public mapManyEmbedded ( array $mapping ) | ||
$mapping | array | The mapping information. |
public mapManyReference ( array $mapping ) | ||
$mapping | array | The mapping information. |
public mapOneEmbedded ( array $mapping ) | ||
$mapping | array | The mapping information. |
public mapOneReference ( array $mapping ) | ||
$mapping | array | The mapping information. |
public setAlsoLoadMethods ( array $methods ) | ||
$methods | array |
public setChangeTrackingPolicy ( integer $policy ) | ||
$policy | integer |
public setCollection ( array | string $name ) | ||
$name | array | string |
public setCollectionCapped ( boolean $bool ) | ||
$bool | boolean |
public setCollectionMax ( integer $max ) | ||
$max | integer |
public setCollectionSize ( integer $size ) | ||
$size | integer |
public setCustomRepositoryClass ( string $repositoryClassName ) | ||
$repositoryClassName | string | The class name of the custom repository. |
public setDatabase ( string $db ) | ||
$db | string | The database name |
public setDefaultDiscriminatorValue ( string $defaultDiscriminatorValue ) | ||
$defaultDiscriminatorValue | string |
public setDiscriminatorField ( string $discriminatorField ) | ||
$discriminatorField | string |
public setDiscriminatorMap ( array $map ) | ||
$map | array |
public setDiscriminatorValue ( string $value ) | ||
$value | string |
public setDistance ( string $distance ) | ||
$distance | string |
public setIdGenerator ( |
||
$generator |
public setIdGeneratorOptions ( array $generatorOptions ) | ||
$generatorOptions | array | Generator options. |
public setIdGeneratorType ( string $generatorType ) | ||
$generatorType | string | Generator type. |
public setIdentifier ( string $identifier ) | ||
$identifier | string |
public setIdentifierValue ( object $document, mixed $id ) | ||
$document | object | |
$id | mixed |
public setInheritanceType ( integer $type ) | ||
$type | integer |
public setLifecycleCallbacks ( array $callbacks ) | ||
$callbacks | array |
public setLockField ( string $lockField ) | ||
$lockField | string |
public setLockMapping ( array &$mapping ) | ||
$mapping | array | The version field mapping array |
public setLockable ( boolean $bool ) | ||
$bool | boolean |
public setParentClasses ( array $classNames ) | ||
$classNames | array |
public setRequireIndexes ( boolean $requireIndexes ) | ||
$requireIndexes | boolean |
public setShardKey ( array $keys, array $options = [] ) | ||
$keys | array | Array of document keys. |
$options | array | Array of sharding options. |
public setSlaveOkay ( boolean | null $slaveOkay ) | ||
$slaveOkay | boolean | null |
public setSubclasses ( array $subclasses ) | ||
$subclasses | array | The names of all mapped subclasses. |
public setVersionField ( string $versionField ) | ||
$versionField | string |
public setVersionMapping ( array &$mapping ) | ||
$mapping | array | The version field mapping array |
public setVersioned ( boolean $bool ) | ||
$bool | boolean |
public setWriteConcern ( string $writeConcern ) | ||
$writeConcern | string |
public array $alsoLoadMethods | ||
리턴 | array |
public array $associationMappings | ||
리턴 | array |
public int $changeTrackingPolicy | ||
리턴 | integer |
public $collection |
public $collectionCapped |
public $collectionMax |
public $collectionSize |
public string $customRepositoryClassName | ||
리턴 | string |
public string $defaultDiscriminatorValue | ||
리턴 | string |
public string $discriminatorField | ||
리턴 | string |
public mixed $discriminatorMap | ||
리턴 | mixed |
public mixed $discriminatorValue | ||
리턴 | mixed |
public $distance |
public array $fieldMappings | ||
리턴 | array |
public $file |
public array $generatorOptions | ||
리턴 | array |
public string $generatorType | ||
리턴 | string |
public AbstractIdGenerator,Doctrine\ODM\MongoDB\Id $idGenerator | ||
리턴 |
public int $inheritanceType | ||
리턴 | integer |
public bool $isEmbeddedDocument | ||
리턴 | boolean |
public bool $isLockable | ||
리턴 | boolean |
public bool $isMappedSuperclass | ||
리턴 | boolean |
public bool $isQueryResultDocument | ||
리턴 | boolean |
public bool $isVersioned | ||
리턴 | boolean |
public array $lifecycleCallbacks | ||
리턴 | array |
public mixed $lockField | ||
리턴 | mixed |
public string $namespace | ||
리턴 | string |
public array $parentClasses | ||
리턴 | array |
public ReflectionClass $reflClass | ||
리턴 | ReflectionClass |
public ReflectionProperty[] $reflFields | ||
리턴 | ReflectionProperty[] |
public $requireIndexes |
public string $rootDocumentName | ||
리턴 | string |
public $shardKey |
public $slaveOkay |
public array $subClasses | ||
리턴 | array |
public mixed $versionField | ||
리턴 | mixed |