PHP Класс Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo

Once populated, ClassMetadata instances are usually cached in a serialized form. IMPORTANT NOTE: The fields of this class are only public for 2 reasons: 1) To allow fast READ access. 2) To drastically reduce the size of a serialized instance (private/protected members get the whole class name, namespace inclusive, prepended to every property in the serialized representation).
С версии: 1.0
Наследование: implements Doctrine\Common\Persistence\Mapping\ClassMetadata
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$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 Doctrine\ODM\MongoDB\Id\AbstractIdGenerator 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 ( AbstractIdGenerator $generator ) 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

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

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

Initializes a new ClassMetadata instance that will hold the object-document mapping metadata of the class with the given name.
public __construct ( string $documentName )
$documentName string The name of the document class the new instance is used for.

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

Add a index for this Document.
public addIndex ( array $keys, array $options = [] )
$keys array Array of keys for the index.
$options array Array of options for the index.

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

This is mainly used to add inherited association mappings to derived classes.
public addInheritedAssociationMapping ( array $mapping ) : void
$mapping array
Результат void

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

This is mainly used to add inherited field mappings to derived classes.
public addInheritedFieldMapping ( array $fieldMapping )
$fieldMapping array

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

If the callback is already registered, this is a NOOP.
public addLifecycleCallback ( string $callback, string $event )
$callback string
$event string

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

Retrieve the collectionClass associated with an association
public getAssociationCollectionClass ( string $assocName )
$assocName string

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

{@inheritDoc}
public getAssociationMappedByTargetField ( $fieldName )

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

{@inheritDoc}
public getAssociationNames ( )

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

{@inheritDoc}
public getAssociationTargetClass ( $assocName )

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

Get the collection this Document is mapped to.
public getCollection ( ) : string
Результат string $collection The collection name.

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

Get whether or not the documents collection is capped.
public getCollectionCapped ( ) : boolean
Результат boolean

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

Get the collection max.
public getCollectionMax ( ) : integer
Результат integer

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

Get the collection size
public getCollectionSize ( ) : integer
Результат integer

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

Returns the database this Document is mapped to.
public getDatabase ( ) : string
Результат string $db The database name.

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

Casts the identifier to its database type.
public getDatabaseIdentifierValue ( mixed $id ) : mixed
$id mixed
Результат mixed $id

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

Returns the distance field name.
public getDistance ( ) : string
Результат string $distance The distance field name.

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

Gets mappings of fields holding embedded document(s).
public getEmbeddedFieldsMappings ( ) : array
Результат array of field mappings

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

Gets the mapping of a field.
public getFieldMapping ( string $fieldName ) : array
$fieldName string The field name.
Результат array The field mapping.

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

E.g. it returns identifier's mapping when called with _id.
public getFieldMappingByDbFieldName ( string $dbFieldName ) : array
$dbFieldName string
Результат array

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

{@inheritDoc}
public getFieldNames ( )

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

Gets the specified field's value off the given document.
public getFieldValue ( object $document, string $field ) : mixed
$document object
$field string
Результат mixed

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

Returns the file field name.
public getFile ( ) : string
Результат string $file The file field name.

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

Since MongoDB only allows exactly one identifier field this will always return an array with only one value
public getIdentifier ( )

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

Since MongoDB only allows exactly one identifier field this will always return an array with only one value

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

Get the document identifier object as a database type.
public getIdentifierObject ( object $document ) : MongoId
$document object
Результат MongoId $id The MongoID object.

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

Gets the document identifier as a PHP type.
public getIdentifierValue ( object $document ) : mixed
$document object
Результат mixed $id

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

Since MongoDB only allows exactly one identifier field this is a proxy to {@see \getIdentifierValue()} and returns an array with the identifier field as a key.
public getIdentifierValues ( $object )

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

Returns the array of indexes for this Document.
public getIndexes ( ) : array
Результат array $indexes The array of indexes.

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

Gets the registered lifecycle callbacks for an event.
public getLifecycleCallbacks ( string $event ) : array
$event string
Результат array

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

{@inheritDoc}
public getName ( )

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

The namespace this Document class belongs to.
public getNamespace ( ) : string
Результат string $namespace The namespace name.

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

Casts the identifier to its portable PHP type.
public getPHPIdentifierValue ( mixed $id ) : mixed
$id mixed
Результат mixed $id

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

{@inheritDoc}
public getReflectionClass ( )

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

Gets the ReflectionProperties of the mapped class.
public getReflectionProperties ( ) : array
Результат array An array of ReflectionProperty instances.

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

Gets a ReflectionProperty for a specific field of the mapped class.
public getReflectionProperty ( string $name ) : ReflectionProperty
$name string
Результат ReflectionProperty

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

public getShardKey ( ) : array
Результат array

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

{@inheritDoc}
public getTypeOfField ( $fieldName )

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

public getWriteConcern ( ) : string
Результат string

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

Checks whether the class has a mapped association (embed or reference) with the given field name.
public hasAssociation ( $fieldName )

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

Checks whether the document has a discriminator field and value configured.
public hasDiscriminator ( ) : boolean
Результат boolean

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

Checks whether the class has a mapped embed with the given field name.
public hasEmbed ( string $fieldName ) : boolean
$fieldName string
Результат boolean

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

{@inheritDoc}
public hasField ( $fieldName )

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

Checks whether this document has indexes or not.
public hasIndexes ( ) : boolean
Результат boolean

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

Checks whether the class has callbacks registered for a lifecycle event.
public hasLifecycleCallbacks ( string $event ) : boolean
$event string Lifecycle event
Результат boolean

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

Checks whether the class has a mapped association with the given field name.
public hasReference ( string $fieldName ) : boolean
$fieldName string
Результат boolean

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

Whether there is a write concern configured for this class.
public hasWriteConcern ( ) : boolean
Результат boolean

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

Dispatches the lifecycle event of the given document by invoking all registered callbacks.
public invokeLifecycleCallbacks ( string $event, object $document, array $arguments = null )
$event string Lifecycle event
$document object Document on which the event occurred
$arguments array Arguments to pass to all callbacks

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

{@inheritDoc}
public isAssociationInverseSide ( $fieldName )

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

Whether the change tracking policy of this class is "deferred explicit".
public isChangeTrackingDeferredExplicit ( ) : boolean
Результат boolean

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

Whether the change tracking policy of this class is "deferred implicit".
public isChangeTrackingDeferredImplicit ( ) : boolean
Результат boolean

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

Whether the change tracking policy of this class is "notify".
public isChangeTrackingNotify ( ) : boolean
Результат boolean

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

Checks whether the class has a mapped reference or embed for the specified field and is a collection valued association.
public isCollectionValuedAssociation ( $fieldName )

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

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).
public isCollectionValuedEmbed ( string $fieldName ) : boolean
$fieldName string
Результат boolean TRUE if the association exists and is collection-valued, FALSE otherwise.

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

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).
public isCollectionValuedReference ( string $fieldName ) : boolean
$fieldName string
Результат boolean TRUE if the association exists and is collection-valued, FALSE otherwise.

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

Returns TRUE if this Document is a file to be stored on the MongoGridFS FALSE otherwise.
public isFile ( ) : boolean
Результат boolean

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

Checks whether the class will generate a new \MongoId instance for us.
public isIdGeneratorAuto ( ) : boolean
Результат boolean TRUE if the class uses the AUTO generator, FALSE otherwise.

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

Checks whether the class will use a collection to generate incremented identifiers.
public isIdGeneratorIncrement ( ) : boolean
Результат boolean TRUE if the class uses the INCREMENT generator, FALSE otherwise.

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

Checks whether the class uses no id generator.
public isIdGeneratorNone ( ) : boolean
Результат boolean TRUE if the class does not use any id generator, FALSE otherwise.

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

Checks whether the class will generate a uuid id.
public isIdGeneratorUuid ( ) : boolean
Результат boolean TRUE if the class uses the UUID generator, FALSE otherwise.

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

{@inheritDoc}
public isIdentifier ( $fieldName )

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

Checks whether the mapped class uses the COLLECTION_PER_CLASS inheritance mapping strategy.
public isInheritanceTypeCollectionPerClass ( ) : boolean
Результат boolean

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

public isInheritanceTypeNone ( ) : boolean
Результат boolean

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

Checks whether the mapped class uses the SINGLE_COLLECTION inheritance mapping strategy.
public isInheritanceTypeSingleCollection ( ) : boolean
Результат boolean

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

Checks whether a mapped field is inherited from an entity superclass.
public isInheritedField ( string $fieldName ) : boolean
$fieldName string
Результат boolean TRUE if the field is inherited, FALSE otherwise.

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

Returns TRUE if this Document is mapped to a collection FALSE otherwise.
public isMappedToCollection ( ) : boolean
Результат boolean

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

Check if the field is not null.
public isNullable ( string $fieldName ) : boolean
$fieldName string The field name
Результат boolean TRUE if the field is not null, FALSE otherwise.

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

Checks whether this document has shard key or not.
public isSharded ( ) : boolean
Результат boolean

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

Checks whether the class has a mapped reference or embed for the specified field and is a single valued association.
public isSingleValuedAssociation ( $fieldName )

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

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).
public isSingleValuedEmbed ( string $fieldName ) : boolean
$fieldName string
Результат boolean TRUE if the association exists and is single-valued, FALSE otherwise.

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

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).
public isSingleValuedReference ( string $fieldName ) : boolean
$fieldName string
Результат boolean TRUE if the association exists and is single-valued, FALSE otherwise.

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

Map a field.
public mapField ( array $mapping ) : array
$mapping array The mapping information.
Результат array

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

Map a MongoGridFSFile.
public mapFile ( array $mapping )
$mapping array The mapping information.

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

Map a collection of embedded documents.
public mapManyEmbedded ( array $mapping )
$mapping array The mapping information.

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

Map a collection of document references.
public mapManyReference ( array $mapping )
$mapping array The mapping information.

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

Map a single embedded document.
public mapOneEmbedded ( array $mapping )
$mapping array The mapping information.

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

Map a single document reference.
public mapOneReference ( array $mapping )
$mapping array The mapping information.

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

Note: A method may be registered multiple times for different fields. it will be invoked only once for the first field found.
public registerAlsoLoadMethod ( string $method, array | string $fields )
$method string Method name
$fields array | string Database field name(s)

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

Any previously registered methods are overwritten.
public setAlsoLoadMethods ( array $methods )
$methods array

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

Sets the change tracking policy used by this class.
public setChangeTrackingPolicy ( integer $policy )
$policy integer

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

Sets the collection this Document is mapped to.
public setCollection ( array | string $name )
$name array | string

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

Set whether or not the documents collection is capped.
public setCollectionCapped ( boolean $bool )
$bool boolean

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

Set the collection max.
public setCollectionMax ( integer $max )
$max integer

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

Set the collection size.
public setCollectionSize ( integer $size )
$size integer

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

Registers a custom repository class for the document class.
public setCustomRepositoryClass ( string $repositoryClassName )
$repositoryClassName string The class name of the custom repository.

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

Set the database this Document is mapped to.
public setDatabase ( string $db )
$db string The database name

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

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
public setDefaultDiscriminatorValue ( string $defaultDiscriminatorValue )
$defaultDiscriminatorValue string

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

The field name is the the unmapped database field. Discriminator values are only used to discern the hydration class and are not mapped to class properties.
public setDiscriminatorField ( string $discriminatorField )
$discriminatorField string

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

Used for JOINED and SINGLE_TABLE inheritance mapping strategies.
public setDiscriminatorMap ( array $map )
$map array

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

Used for JOINED/SINGLE_TABLE inheritance and multiple document types in a single collection.
public setDiscriminatorValue ( string $value )
$value string

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

Set the field name that stores the distance.
public setDistance ( string $distance )
$distance string

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

Sets the specified field to the specified value on the given document.
public setFieldValue ( object $document, string $field, mixed $value )
$document object
$field string
$value mixed

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

Set the field name that stores the grid file.
public setFile ( string $file )
$file string

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

Sets the ID generator used to generate IDs for instances of this class.
public setIdGenerator ( AbstractIdGenerator $generator )
$generator Doctrine\ODM\MongoDB\Id\AbstractIdGenerator

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

Sets the Id generator options.
public setIdGeneratorOptions ( array $generatorOptions )
$generatorOptions array Generator options.

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

Sets the type of Id generator to use for the mapped class.
public setIdGeneratorType ( string $generatorType )
$generatorType string Generator type.

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

INTERNAL: Sets the mapped identifier field of this class.
public setIdentifier ( string $identifier )
$identifier string

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

The value will be converted to a PHP type before being set.
public setIdentifierValue ( object $document, mixed $id )
$document object
$id mixed

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

Sets the inheritance type used by the class and it's subclasses.
public setInheritanceType ( integer $type )
$type integer

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

Any previously registered callbacks are overwritten.
public setLifecycleCallbacks ( array $callbacks )
$callbacks array

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

Sets the name of the field that is to be used for storing whether a document is currently locked or not.
public setLockField ( string $lockField )
$lockField string

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

Sets the version field mapping used for versioning. Sets the default value to use depending on the column type.
public setLockMapping ( array &$mapping )
$mapping array The version field mapping array

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

Sets whether this class is to allow pessimistic locking.
public setLockable ( boolean $bool )
$bool boolean

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

Assumes that the class names in the passed array are in the order: directParent -> directParentParent -> directParentParentParent ... -> root.
public setParentClasses ( array $classNames )
$classNames array

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

Set whether or not queries on this document should require indexes.
Устаревший: method was deprecated in 1.2 and will be removed in 2.0
public setRequireIndexes ( boolean $requireIndexes )
$requireIndexes boolean

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

Set shard key for this Document.
public setShardKey ( array $keys, array $options = [] )
$keys array Array of document keys.
$options array Array of sharding options.

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

Sets the slaveOkay option applied to collections for this class.
public setSlaveOkay ( boolean | null $slaveOkay )
$slaveOkay boolean | null

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

Sets the mapped subclasses of this class.
public setSubclasses ( array $subclasses )
$subclasses array The names of all mapped subclasses.

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

Sets the name of the field that is to be used for versioning if this class is versioned for optimistic locking.
public setVersionField ( string $versionField )
$versionField string

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

Sets the version field mapping used for versioning. Sets the default value to use depending on the column type.
public setVersionMapping ( array &$mapping )
$mapping array The version field mapping array

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

Sets whether this class is to be versioned for optimistic locking.
public setVersioned ( boolean $bool )
$bool boolean

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

Sets the write concern used by this class.
public setWriteConcern ( string $writeConcern )
$writeConcern string

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

$alsoLoadMethods публичное свойство

READ-ONLY: Array of fields to also load with a given method.
public array $alsoLoadMethods
Результат array

$associationMappings публичное свойство

Keys are field names and values are mapping definitions.
public array $associationMappings
Результат array

$changeTrackingPolicy публичное свойство

READ-ONLY: The policy used for change-tracking on entities of this class.
public int $changeTrackingPolicy
Результат integer

$collection публичное свойство

READ-ONLY: The name of the mongo collection the document is mapped to.
public $collection

$collectionCapped публичное свойство

READ-ONLY: If the collection should be a fixed size.
public $collectionCapped

$collectionMax публичное свойство

READ-ONLY: If the collection is fixed size, the maximum number of elements to store in the collection.
public $collectionMax

$collectionSize публичное свойство

READ-ONLY: If the collection is fixed size, its size in bytes.
public $collectionSize

$customRepositoryClassName публичное свойство

(Optional).
public string $customRepositoryClassName
Результат string

$db публичное свойство

READ-ONLY: The name of the mongo database the document is mapped to.
public $db

$defaultDiscriminatorValue публичное свойство

READ-ONLY: The default value for discriminatorField in case it's not set in the document
См. также: discriminatorField
public string $defaultDiscriminatorValue
Результат string

$discriminatorField публичное свойство

READ-ONLY: The definition of the discriminator field used in SINGLE_COLLECTION inheritance mapping.
public string $discriminatorField
Результат string

$discriminatorMap публичное свойство

This does only apply to the SINGLE_COLLECTION inheritance mapping strategy where a discriminator field is used.
См. также: discriminatorField
public mixed $discriminatorMap
Результат mixed

$discriminatorValue публичное свойство

This does only apply to the JOINED and SINGLE_COLLECTION inheritance mapping strategies where a discriminator field is used.
См. также: discriminatorField
public mixed $discriminatorValue
Результат mixed

$distance публичное свойство

READ-ONLY: The field that stores the calculated distance when performing geo spatial queries.
public $distance

$fieldMappings публичное свойство

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.
public array $fieldMappings
Результат array

$file публичное свойство

READ-ONLY: The field that stores a file reference and indicates the document is a file and should be stored on the MongoGridFS.
public $file

$generatorOptions публичное свойство

READ-ONLY: The Id generator options.
public array $generatorOptions
Результат array

$generatorType публичное свойство

READ-ONLY: The Id generator type used by the class.
public string $generatorType
Результат string

$idGenerator публичное свойство

READ-ONLY: The ID generator used for generating IDs for this class.
public AbstractIdGenerator,Doctrine\ODM\MongoDB\Id $idGenerator
Результат Doctrine\ODM\MongoDB\Id\AbstractIdGenerator

$identifier публичное свойство

READ-ONLY: The field name of the document identifier.
public $identifier

$indexes публичное свойство

READ-ONLY: The array of indexes for the document collection.
public $indexes

$inheritanceType публичное свойство

READ-ONLY: The inheritance mapping type used by the class.
public int $inheritanceType
Результат integer

$isEmbeddedDocument публичное свойство

READ-ONLY: Whether this class describes the mapping of a embedded document.
public bool $isEmbeddedDocument
Результат boolean

$isLockable публичное свойство

READ-ONLY: A flag for whether or not instances of this class are to allow pessimistic locking.
public bool $isLockable
Результат boolean

$isMappedSuperclass публичное свойство

READ-ONLY: Whether this class describes the mapping of a mapped superclass.
public bool $isMappedSuperclass
Результат boolean

$isQueryResultDocument публичное свойство

READ-ONLY: Whether this class describes the mapping of an aggregation result document.
public bool $isQueryResultDocument
Результат boolean

$isVersioned публичное свойство

READ-ONLY: A flag for whether or not instances of this class are to be versioned with optimistic locking.
public bool $isVersioned
Результат boolean

$lifecycleCallbacks публичное свойство

READ-ONLY: The registered lifecycle callbacks for documents of this class.
public array $lifecycleCallbacks
Результат array

$lockField публичное свойство

READ-ONLY: The name of the field which is used for locking a document.
public mixed $lockField
Результат mixed

$name публичное свойство

READ-ONLY: The name of the document class.
public $name

$namespace публичное свойство

READ-ONLY: The namespace the document class is contained in.
public string $namespace
Результат string

$parentClasses публичное свойство

READ-ONLY: The names of the parent classes (ancestors).
public array $parentClasses
Результат array

$reflClass публичное свойство

The ReflectionClass instance of the mapped class.
public ReflectionClass $reflClass
Результат ReflectionClass

$reflFields публичное свойство

The ReflectionProperty instances of the mapped class.
public ReflectionProperty[] $reflFields
Результат ReflectionProperty[]

$requireIndexes публичное свойство

READ-ONLY: Whether or not queries on this document should require indexes.
Устаревший: property was deprecated in 1.2 and will be removed in 2.0
public $requireIndexes

$rootDocumentName публичное свойство

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}.
public string $rootDocumentName
Результат string

$shardKey публичное свойство

READ-ONLY: Keys and options describing shard key. Only for sharded collections.
public $shardKey

$slaveOkay публичное свойство

READ-ONLY: Whether or not reads for this class are okay to read from a slave.
public $slaveOkay

$subClasses публичное свойство

READ-ONLY: The names of all subclasses (descendants).
public array $subClasses
Результат array

$versionField публичное свойство

READ-ONLY: The name of the field which is used for versioning in optimistic locking (if any).
public mixed $versionField
Результат mixed

$writeConcern публичное свойство

READ-ONLY: Describes the level of acknowledgement requested from MongoDB for write operations.
public $writeConcern