ClassMetadata
class ClassMetadata implements ClassMetadata (View source)
Metadata class
Constants
IDGENERATOR_UUID |
|
IDGENERATOR_ASSIGNED |
|
TO_ONE |
|
TO_MANY |
|
ONE_TO_ONE |
|
ONE_TO_MANY |
|
MANY_TO_ONE |
|
MANY_TO_MANY |
|
CASCADE_PERSIST |
|
CASCADE_REMOVE |
|
CASCADE_MERGE |
|
CASCADE_DETACH |
|
CASCADE_REFRESH |
|
CASCADE_ALL |
|
Properties
$idGenerator | |||
$identifier | READ-ONLY: The field name of the document identifier. | ||
$name | READ-ONLY: The name of the document class. | ||
$rootDocumentName | READ-ONLY: The root document class name. | ||
$inInheritanceHierachy | READ-ONLY: Is this entity in an inheritance hierachy? | ||
$parentClasses | READ-ONLY: a list of all parent classes. | ||
string | $namespace | READ-ONLY: The namespace the document class is contained in. | |
string | $customRepositoryClassName | The name of the custom repository class used for the document class. | |
array | $fieldMappings | READ-ONLY: The field mappings of the class. | |
array | $indexes | An array of indexed fields, accessible through a generic view shipped with Doctrine. | |
bool | $indexed | Is this class indexed? If yes, then a findAll() query can be executed for this type. | |
array | $jsonNames | An array of json result-key-names to field-names | |
array | $alsoLoadMethods | READ-ONLY: Array of fields to also load with a given method. | |
boolean | $isMappedSuperclass | READ-ONLY: Whether this class describes the mapping of a mapped superclass. | |
boolean | $isEmbeddedDocument | READ-ONLY: Whether this class describes the mapping of a embedded document. | |
bool | $isReadOnly | READ-ONLY: Wheather the document or embedded document is read-only and will be skipped in change-tracking. | |
array | $associationsMappings | READ-ONLY | |
bool | $isVersioned | CouchDB documents are always versioned, this flag determines if this version is exposed to the userland. | |
string | $versionField | Version Field stores the CouchDB Revision | |
bool | $hasAttachments | ||
string | $attachmentField | Field that stores the attachments as a key->value array of file-names to attachment objects. | |
string|null | $attachmentDeclaredClass | If in an inheritance scenario the attachment field is on a super class, this is its name. | |
ReflectionClass | $reflClass | The ReflectionClass instance of the mapped class. | |
array | $reflFields | The ReflectionProperty instances of the mapped class. |
Methods
Initializes a new ClassMetadata instance that will hold the object-document mapping metadata of the class with the given name.
Used to derive a class metadata of the current instance for a mapped child class.
Determines which fields get serialized.
Restores some state that can not be serialized/unserialized.
Creates a new instance of the mapped class, without invoking the constructor.
Gets the ReflectionClass instance of the mapped class.
Gets the ReflectionPropertys of the mapped class.
Gets a ReflectionProperty for a specific field of the mapped class.
Sets the document identifier of a document.
Gets the document identifier.
Get identifier values of this document.
Sets the specified field to the specified value on the given document.
Gets the specified field's value off the given document.
Checks whether a field is part of the identifier/primary key field(s).
INTERNAL: Sets the mapped identifier field of this class.
Gets the mapped identifier field of this class.
Get identifier field names of this class.;
Checks whether the class has a (mapped) field with a certain name.
Registers a custom repository class for the document class.
The name of this Document class.
The namespace this Document class belongs to.
Set the field that will contain attachments of this document.
Map an embedded object
Map a field.
No description
No description
No description
No description
No description
A numerically indexed list of field names of this persistent class.
Gets the mapping of a field.
Gets the type of a field.
Checks if the given field is a mapped association for this class.
No description
Checks if the given field is a mapped single valued association for this class.
A numerically indexed list of association names of this persistent class.
Returns the target class name of the given association.
{@inheritDoc}
{@inheritDoc}
No description
No description
No description
No description
Initializes a new ClassMetadata instance that will hold the object-relational mapping metadata of the class with the given name.
Details
at line 215
__construct(string $documentName)
Initializes a new ClassMetadata instance that will hold the object-document mapping metadata of the class with the given name.
at line 228
deriveChildMetadata(ClassMetadata $child)
Used to derive a class metadata of the current instance for a mapped child class.
at line 275
array
__sleep()
Determines which fields get serialized.
It is only serialized what is necessary for best unserialization performance. That means any metadata properties that are not set or empty or simply have their default value are NOT serialized.
Parts that are also NOT serialized because they can not be properly unserialized: - reflClass (ReflectionClass) - reflFields (ReflectionProperty array)
at line 334
wakeupReflection($reflService)
Restores some state that can not be serialized/unserialized.
at line 378
object
newInstance()
Creates a new instance of the mapped class, without invoking the constructor.
at line 388
ReflectionClass
getReflectionClass()
Gets the ReflectionClass instance of the mapped class.
at line 401
array
getReflectionProperties()
Gets the ReflectionPropertys of the mapped class.
at line 412
ReflectionProperty
getReflectionProperty(string $name)
Gets a ReflectionProperty for a specific field of the mapped class.
at line 424
setIdentifierValue(object $document, mixed $id)
Sets the document identifier of a document.
at line 435
string
getIdentifierValue(object $document)
Gets the document identifier.
at line 450
array
getIdentifierValues(object $document)
Get identifier values of this document.
Since CouchDB only allows exactly one identifier field this is a proxy to {see getIdentifierValue()} and returns an array with the identifier field as a key.
at line 462
setFieldValue(object $document, string $field, mixed $value)
Sets the specified field to the specified value on the given document.
at line 473
getFieldValue(object $document, string $field)
Gets the specified field's value off the given document.
at line 485
boolean
isIdentifier(string $fieldName)
Checks whether a field is part of the identifier/primary key field(s).
at line 497
setIdentifier(string $identifier)
INTERNAL: Sets the mapped identifier field of this class.
at line 510
string
getIdentifier()
Gets the mapped identifier field of this class.
at line 523
array
getIdentifierFieldNames()
Get identifier field names of this class.;
Since CouchDB only allows exactly one identifier field this is a proxy to {see getIdentifier()} and returns an array.
at line 534
boolean
hasField($fieldName)
Checks whether the class has a (mapped) field with a certain name.
at line 544
setCustomRepositoryClass(string $repositoryClassName)
Registers a custom repository class for the document class.
at line 554
string
getName()
The name of this Document class.
at line 564
string
getNamespace()
The namespace this Document class belongs to.
at line 575
mapAttachments(string $fieldName)
Set the field that will contain attachments of this document.
at line 595
mapEmbedded(array $mapping)
Map an embedded object
- fieldName - The name of the property/field on the mapped php class
- jsonName - JSON key name of this field in CouchDB.
- targetDocument - Name of the target document
- embedded - one or many embedded objects?
at line 616
mapField(array $mapping)
Map a field.
- type - The Doctrine Type of this field.
- fieldName - The name of the property/field on the mapped php class
- jsonName - JSON key name of this field in CouchDB.
- name - The JSON key of this field in the CouchDB document
- id - True for an ID field.
- strategy - ID Generator strategy when the field is an id-field.
- indexed - Is this field indexed for the Doctrine CouchDB repository view
- isVersionField - Is this field containing the revision number of this document?
at line 643
protected
validateAndCompleteFieldMapping($mapping)
at line 658
protected
validateAndCompleteReferenceMapping($mapping)
at line 666
protected
validateAndCompleteAssociationMapping($mapping)
at line 675
mapManyToOne($mapping)
at line 687
mapManyToMany($mapping)
at line 720
array
getFieldNames()
A numerically indexed list of field names of this persistent class.
This array includes identifier fields if present on this class.
at line 732
array
getFieldMapping(string $fieldName)
Gets the mapping of a field.
at line 746
Type
getTypeOfField(string $fieldName)
Gets the type of a field.
at line 758
boolean
hasAssociation(string $fieldName)
Checks if the given field is a mapped association for this class.
at line 763
isCollectionValuedAssociation($name)
at line 775
boolean
isSingleValuedAssociation(string $fieldName)
Checks if the given field is a mapped single valued association for this class.
at line 788
array
getAssociationNames()
A numerically indexed list of association names of this persistent class.
This array includes identifier associations if present on this class.
at line 800
string
getAssociationTargetClass(string $assocName)
Returns the target class name of the given association.
at line 811
getAssociationMappedByTargetField($assocName)
{@inheritDoc}
at line 819
isAssociationInverseSide($assocName)
{@inheritDoc}
at line 824
isInheritedField($field)
at line 829
isInheritedAssociation($field)
at line 834
setParentClasses($classes)
at line 843
markInheritanceRoot()
at line 859
void
initializeReflection(ReflectionService $reflService)
Initializes a new ClassMetadata instance that will hold the object-relational mapping metadata of the class with the given name.