Свойство | Тип | Описание | |
---|---|---|---|
$childClasses | array | If empty then any classes are permitted. | |
$childMappings | array | READ-ONLY: The child mappings of the class. | |
$childrenMappings | array | READ-ONLY: The children mappings of the class. | |
$customRepositoryClassName | string | (Optional). | |
$depthMapping | string | READ-ONLY: Name of the depth property | |
$fieldMappings | array | READ-ONLY: The field mappings of 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. | ||
$inheritMixins | boolean | READ-ONLY: Inherit parent class' mixins (default) or not | |
$isLeaf | boolean | READ-ONLY: If the document should be act as a leaf-node and therefore not be allowed children. | |
$isMappedSuperclass | boolean | READ-ONLY: Whether this class describes the mapping of a mapped superclass. | |
$lifecycleCallbacks | array | READ-ONLY: The registered lifecycle callbacks for documents of this class. | |
$localeMapping | string | READ-ONLY: Name of the locale property | |
$mappings | 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. | |
$mixedReferrersMappings | array | READ-ONLY: The mixed referrers (read only) mappings of the class. | |
$mixins | array | READ-ONLY: The JCR Mixins to be used for this node (including inherited mixins) | |
$name | READ-ONLY: The name of the document class that is stored in the phpcr:class property | ||
$namespace | string | READ-ONLY: The namespace the document class is contained in. | |
$node | string | READ-ONLY: The field name of the node | |
$nodeType | string | READ-ONLY: The JCR Nodetype to be used for this node | |
$nodename | string | READ-ONLY except on document creation: The field name for the name of the node. | |
$parentClasses | array | READ-ONLY: Mapped parent classes. | |
$parentMapping | string | READ-ONLY except on document creation: The field name for the parent document. | |
$referenceMappings | array | READ-ONLY: The reference mappings of the class. | |
$referenceable | boolean | READ-ONLY: determines if the document is referenceable or not | |
$referrersMappings | array | READ-ONLY: The referrers mappings of the class. | |
$reflClass | ReflectionClass | The ReflectionClass instance of the mapped class. | |
$reflFields | ReflectionPropert\ReflectionProperty[] | READ-ONLY: The ReflectionProperty instances of the mapped class. | |
$translatableFields | array | READ-ONLY: List of translatable fields | |
$translator | string | This is the key used for DocumentManagerInterface::getTranslationStrategy | |
$uniqueNodeType | boolean | READ-ONLY: If true, consider this document's node type to be unique among all mappings. | |
$uuidFieldName | READ-ONLY: The field name of the UUID field | ||
$versionCreatedField | string | READ-ONLY: Name of the version created property of this document | |
$versionNameField | string | READ-ONLY: Name of the version name property of this document | |
$versionable | boolean | string | READ-ONLY: Whether this document should be versioned. If this is not false, it will be one of the values from self::validVersionableAnnotations |
Свойство | Тип | Описание | |
---|---|---|---|
$validVersionableAnnotations |
Метод | Описание | |
---|---|---|
__construct ( string $className ) | Initializes a new ClassMetadata instance that will hold the object-document mapping metadata of the class with the given name. | |
__sleep ( ) : array | Determines which fields get serialized. | |
addLifecycleCallback ( string $callback, string $event ) | Adds a lifecycle callback for documents of this class. | |
assertValidChildClass ( |
Assert that the given class FQN can be a child of the document this metadata represents. | |
fullyQualifiedClassName ( string $className ) : string | ||
getAssociation ( $fieldName ) : array | ||
getAssociationMappedByTargetField ( $assocName ) | {@inheritDoc} | |
getAssociationNames ( ) | {@inheritDoc} | |
getAssociationTargetClass ( $fieldName ) | {@inheritDoc} | |
getChildClasses ( ) : string[] | Return the class names or interfaces that children of this document must be an instance of. | |
getField ( $fieldName ) | {@inheritDoc} | |
getFieldMapping ( string $fieldName ) : array | Gets the mapping of a (regular) field that holds some data but not a reference to another object. | |
getFieldNames ( ) | {@inheritDoc} | |
getFieldValue ( object $document, string $field ) : mixed | null | Gets the specified field's value off the given document. | |
getIdentifier ( ) | {@inheritDoc} | |
getIdentifierFieldNames ( ) : array | Get identifier field names of this class. | |
getIdentifierValue ( object $document ) : string | Gets the document identifier. | |
getIdentifierValues ( object $document ) : array | Get identifier values of this document. | |
getInheritMixins ( ) : boolean | Return whether to inherit mixins from parent | |
getLifecycleCallbacks ( string $event ) : array | Gets the registered lifecycle callbacks for an event. | |
getMixins ( ) : array | Return the JCR mixins to be used for this node. | |
getName ( ) | {@inheritDoc} | |
getNamespace ( ) : string | The namespace this Document class belongs to. | |
getNodeType ( ) : string | Return the JCR node type to be used for this node. | |
getParentClasses ( ) : array | Return the mapped parent classes | |
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. | |
getTypeOfField ( $fieldName ) | {@inheritDoc} | |
getUuidFieldName ( ) | ||
hasAssociation ( $fieldName ) | {@inheritDoc} | |
hasField ( $fieldName ) | {@inheritDoc} | |
hasLifecycleCallbacks ( string $lifecycleEvent ) : boolean | Whether the class has any attached lifecycle listeners or callbacks for a lifecycle event. | |
hasUniqueNodeType ( ) : boolean | Return true if this document has a unique node type among all mappings. | |
initializeReflection ( Doctrine\Common\Persistence\Mapping\ReflectionService $reflService ) | Initializes a new ClassMetadata instance that will hold the object-relational mapping metadata of the class with the given name. | |
invokeLifecycleCallbacks ( string $lifecycleEvent, object $document, array $arguments = null ) | Dispatches the lifecycle event of the given document to the registered lifecycle callbacks and lifecycle listeners. | |
isAssociationInverseSide ( $assocName ) | {@inheritDoc} | |
isCollectionValuedAssociation ( $fieldName ) | {@inheritDoc} | |
isIdGeneratorNone ( ) : boolean | Checks whether the class uses no id generator. | |
isIdGeneratorRepository ( ) : boolean | Checks whether the class will generate an id via the repository. | |
isIdentifier ( $fieldName ) | {@inheritDoc} | |
isInheritedField ( $fieldName ) : boolean | Checks whether a mapped field is inherited from an entity superclass. | |
isLeaf ( ) : boolean | Return true if this is designated as a leaf node. | |
isNullable ( string $fieldName ) : boolean | Check if the field is nullable or not. | |
isSingleValuedAssociation ( $fieldName ) | {@inheritDoc} | |
isUuid ( string $fieldName ) : boolean | Whether $fieldName is the universally unique identifier of the document. | |
isValidNodename ( string $nodeName ) : PHPCR\RepositoryException | null | Check if this node name is valid. Returns null if valid, an exception otherwise. | |
mapChild ( array $mapping, |
||
mapChildren ( array $mapping, |
||
mapDepth ( array $mapping, |
||
mapField ( array $mapping, |
Map a field. | |
mapId ( array $mapping, |
||
mapLifecycleCallbacks ( array $mapping ) | ||
mapLocale ( array $mapping, |
||
mapManyToMany ( $mapping, |
||
mapManyToOne ( $mapping, |
||
mapMixedReferrers ( array $mapping, |
||
mapNode ( array $mapping, |
||
mapNodename ( array $mapping, |
||
mapParentDocument ( array $mapping, |
||
mapReferrers ( array $mapping, |
||
mapVersionCreated ( array $mapping, |
||
mapVersionName ( array $mapping, |
||
newInstance ( ) : object | Creates a new instance of the mapped class, without invoking the constructor. | |
setChildClasses ( array $childClasses ) | Set the class names or interfaces that children of this document must be instance of. | |
setCustomRepositoryClassName ( string $repositoryClassName ) | Registers a custom repository class for the document class. | |
setFieldValue ( object $document, string $field, mixed $value ) | Sets the specified field to the specified value on the given document. | |
setIdentifier ( string $identifier ) | INTERNAL: Sets the mapped identifier field of this class. | |
setIdentifierValue ( object $document, mixed $id ) | Sets the document identifier of a document. | |
setInheritMixins ( boolean $inheritMixins ) | Set whether to inherit mixins from parent | |
setIsLeaf ( boolean $isLeaf ) | Set if this document should act as a leaf node. | |
setLifecycleCallbacks ( array $callbacks ) | Sets the lifecycle callbacks for documents of this class. | |
setMixins ( array $mixins ) | Set the JCR mixins | |
setNodeType ( string $nodeType ) | ||
setParentClasses ( array $parentClasses ) | Set the mapped parent classes | |
setReferenceable ( boolean $referenceable ) | ||
setTranslator ( $translator ) | Sets the translator strategy key | |
setUniqueNodeType ( boolean $uniqueNodeType ) | ||
setVersioned ( string | boolean $versionable ) | ||
validateChildClasses ( ) | Validate that childClasses is empty if isLeaf is true. | |
validateClassMapping ( ) | Finalize the mapping and make sure that it is consistent. | |
validateIdentifier ( ) | Validate Identifier mapping, determine the strategy if none is explicitly set. | |
validateLifecycleCallbacks ( Doctrine\Common\Persistence\Mapping\ReflectionService $reflService ) | Validate lifecycle callbacks | |
validateReferenceable ( ) | Validate whether this class needs to be referenceable. | |
validateReferences ( ) | Validate association targets actually exist. | |
validateTranslatables ( ) | Validate translatable fields - ensure that the document has a translator strategy in place. | |
wakeupReflection ( Doctrine\Common\Persistence\Mapping\ReflectionService $reflService ) | Restores some state that can not be serialized/unserialized. |
Метод | Описание | |
---|---|---|
setIdGenerator ( string $generator ) | Sets the ID generator used to generate IDs for instances of this class. | |
validateAndCompleteAssociationMapping ( $mapping, |
||
validateAndCompleteFieldMapping ( array $mapping, |
Метод | Описание | |
---|---|---|
determineIdStrategy ( ) | Determine the id strategy for this document. Only call this if no explicit strategy was assigned. |
public __construct ( string $className ) | ||
$className | string | The name of the document class the new instance is used for. |
public addLifecycleCallback ( string $callback, string $event ) | ||
$callback | string | |
$event | string |
public assertValidChildClass ( |
||
$class |
public fullyQualifiedClassName ( string $className ) : string | ||
$className | string | |
Результат | string |
public getAssociation ( $fieldName ) : array | ||
Результат | array | the association mapping with the field of this name |
public getAssociationMappedByTargetField ( $assocName ) |
public getAssociationTargetClass ( $fieldName ) |
public getChildClasses ( ) : string[] | ||
Результат | string[] |
public getFieldMapping ( string $fieldName ) : array | ||
$fieldName | string | The field name. |
Результат | array | The field mapping. |
public getIdentifierFieldNames ( ) : array | ||
Результат | array |
public getIdentifierValue ( object $document ) : string | ||
$document | object | |
Результат | string | $id |
public getIdentifierValues ( object $document ) : array | ||
$document | object | |
Результат | array |
public getInheritMixins ( ) : boolean | ||
Результат | boolean |
public getLifecycleCallbacks ( string $event ) : array | ||
$event | string | |
Результат | array |
public getNamespace ( ) : string | ||
Результат | string | $namespace The namespace name. |
public getNodeType ( ) : string | ||
Результат | string |
public getParentClasses ( ) : array | ||
Результат | array | of mapped class FQNs |
public getReflectionProperties ( ) : array | ||
Результат | array | An array of \ReflectionProperty instances. |
public getReflectionProperty ( string $name ) : ReflectionProperty | ||
$name | string | |
Результат | ReflectionProperty |
public hasLifecycleCallbacks ( string $lifecycleEvent ) : boolean | ||
$lifecycleEvent | string | |
Результат | boolean |
public hasUniqueNodeType ( ) : boolean | ||
Результат | boolean |
public initializeReflection ( Doctrine\Common\Persistence\Mapping\ReflectionService $reflService ) | ||
$reflService | Doctrine\Common\Persistence\Mapping\ReflectionService |
public isAssociationInverseSide ( $assocName ) |
public isCollectionValuedAssociation ( $fieldName ) |
public isIdGeneratorNone ( ) : boolean | ||
Результат | boolean | TRUE if the class does not use any id generator, FALSE otherwise. |
public isIdGeneratorRepository ( ) : boolean | ||
Результат | boolean | TRUE if the class uses the Repository generator, FALSE otherwise. |
public isInheritedField ( $fieldName ) : boolean | ||
Результат | boolean | string class name if the field is inherited, FALSE otherwise. |
public isNullable ( string $fieldName ) : boolean | ||
$fieldName | string | The field name |
Результат | boolean | TRUE if the field is nullable, FALSE otherwise. |
public isSingleValuedAssociation ( $fieldName ) |
public isValidNodename ( string $nodeName ) : PHPCR\RepositoryException | null | ||
$nodeName | string | The node local name |
Результат | PHPCR\RepositoryException | null |
public mapChildren ( array $mapping, |
||
$mapping | array | |
$inherited |
public mapLifecycleCallbacks ( array $mapping ) | ||
$mapping | array |
public mapManyToMany ( $mapping, |
||
$inherited |
public mapManyToOne ( $mapping, |
||
$inherited |
public mapMixedReferrers ( array $mapping, |
||
$mapping | array | |
$inherited |
public mapNodename ( array $mapping, |
||
$mapping | array | |
$inherited |
public mapParentDocument ( array $mapping, |
||
$mapping | array | |
$inherited |
public mapReferrers ( array $mapping, |
||
$mapping | array | |
$inherited |
public mapVersionCreated ( array $mapping, |
||
$mapping | array | |
$inherited |
public mapVersionName ( array $mapping, |
||
$mapping | array | |
$inherited |
public newInstance ( ) : object | ||
Результат | object |
public setChildClasses ( array $childClasses ) | ||
$childClasses | array |
public setCustomRepositoryClassName ( string $repositoryClassName ) | ||
$repositoryClassName | string | The class name of the custom repository. |
protected setIdGenerator ( string $generator ) | ||
$generator | string |
public setIdentifier ( string $identifier ) | ||
$identifier | string |
public setIdentifierValue ( object $document, mixed $id ) | ||
$document | object | |
$id | mixed |
public setInheritMixins ( boolean $inheritMixins ) | ||
$inheritMixins | boolean |
public setLifecycleCallbacks ( array $callbacks ) | ||
$callbacks | array |
public setParentClasses ( array $parentClasses ) | ||
$parentClasses | array |
public setReferenceable ( boolean $referenceable ) | ||
$referenceable | boolean |
public setTranslator ( $translator ) |
public setUniqueNodeType ( boolean $uniqueNodeType ) | ||
$uniqueNodeType | boolean |
public setVersioned ( string | boolean $versionable ) | ||
$versionable | string | boolean | A valid versionable annotation or false to disable versioning. |
protected validateAndCompleteAssociationMapping ( $mapping, |
||
$inherited |
protected validateAndCompleteFieldMapping ( array $mapping, |
||
$mapping | array | |
$inherited | same field of parent document, if any | |
$isField | boolean | whether this is a field or an association |
$phpcrLabel | string | the name for the phpcr thing. usually property, except for child where this is name. referrers use false to not set anything. |
Результат | mixed |
public validateChildClasses ( ) |
public validateClassMapping ( ) |
public validateIdentifier ( ) |
public validateLifecycleCallbacks ( Doctrine\Common\Persistence\Mapping\ReflectionService $reflService ) | ||
$reflService | Doctrine\Common\Persistence\Mapping\ReflectionService |
public validateReferenceable ( ) |
public validateReferences ( ) |
public validateTranslatables ( ) |
public wakeupReflection ( Doctrine\Common\Persistence\Mapping\ReflectionService $reflService ) | ||
$reflService | Doctrine\Common\Persistence\Mapping\ReflectionService |
public array $childClasses | ||
Результат | array |
public array $childMappings | ||
Результат | array |
public array $childrenMappings | ||
Результат | array |
public string $customRepositoryClassName | ||
Результат | string |
public string $depthMapping | ||
Результат | string |
public array $fieldMappings | ||
Результат | array |
public $idGenerator |
public $identifier |
public bool $inheritMixins | ||
Результат | boolean |
public bool $isLeaf | ||
Результат | boolean |
public bool $isMappedSuperclass | ||
Результат | boolean |
public array $lifecycleCallbacks | ||
Результат | array |
public string $localeMapping | ||
Результат | string |
public array $mappings | ||
Результат | array |
public array $mixedReferrersMappings | ||
Результат | array |
public array $mixins | ||
Результат | array |
public $name |
public string $namespace | ||
Результат | string |
public string $nodeType | ||
Результат | string |
public string $nodename | ||
Результат | string |
public array $parentClasses | ||
Результат | array |
public string $parentMapping | ||
Результат | string |
public array $referenceMappings | ||
Результат | array |
public bool $referenceable | ||
Результат | boolean |
public array $referrersMappings | ||
Результат | array |
public ReflectionClass $reflClass | ||
Результат | ReflectionClass |
public ReflectionProperty[],ReflectionPropert $reflFields | ||
Результат | ReflectionPropert\ReflectionProperty[] |
public array $translatableFields | ||
Результат | array |
public string $translator | ||
Результат | string |
public bool $uniqueNodeType | ||
Результат | boolean |
protected static $validVersionableAnnotations |
public string $versionCreatedField | ||
Результат | string |
public string $versionNameField | ||
Результат | string |