PHP 클래스 Doctrine\ODM\CouchDB\Mapping\ClassMetadata

부터: 1.0
저자: Benjamin Eberlei ([email protected])
저자: Lukas Kahwe Smith ([email protected])
상속: extends Doctrine\ODM\CouchDB\Mapping\ClassMetadataInfo, implements Doctrine\Common\Persistence\Mapping\ClassMetadata
파일 보기 프로젝트 열기: doctrine/couchdb-odm 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$alsoLoadMethods array READ-ONLY: Array of fields to also load with a given method.
$associationsMappings array READ-ONLY
$attachmentDeclaredClass string | null If in an inheritance scenario the attachment field is on a super class, this is its name.
$attachmentField string Field that stores the attachments as a key->value array of file-names to attachment objects.
$customRepositoryClassName string (Optional).
$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.
$hasAttachments boolean
$idGenerator
$identifier READ-ONLY: The field name of the document identifier.
$inInheritanceHierachy READ-ONLY: Is this entity in an inheritance hierachy?
$indexed boolean Is this class indexed? If yes, then a findAll() query can be executed for this type.
$indexes array An array of indexed fields, accessible through a generic view shipped with Doctrine.
$isEmbeddedDocument boolean READ-ONLY: Whether this class describes the mapping of a embedded document.
$isMappedSuperclass boolean READ-ONLY: Whether this class describes the mapping of a mapped superclass.
$isReadOnly boolean This should be set to true for value objects, for example attachments. Replacing the reference with a new value object will trigger an update.
$isVersioned boolean CouchDB documents are always versioned, this flag determines if this version is exposed to the userland.
$jsonNames array An array of json result-key-names to field-names
$name READ-ONLY: The name of the document class.
$namespace string READ-ONLY: The namespace the document class is contained in.
$parentClasses READ-ONLY: a list of all parent classes.
$reflClass ReflectionClas\ReflectionClass The ReflectionClass instance of the mapped class.
$reflFields array The ReflectionProperty instances of the mapped class.
$rootDocumentName READ-ONLY: The root document class name.
$versionField string Version Field stores the CouchDB Revision

공개 메소드들

메소드 설명
__construct ( string $documentName ) 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.
deriveChildMetadata ( ClassMetadata $child ) Used to derive a class metadata of the current instance for a mapped child class.
getAssociationMappedByTargetField ( $assocName ) {@inheritDoc}
getAssociationNames ( ) : array A numerically indexed list of association names of this persistent class.
getAssociationTargetClass ( string $assocName ) : string Returns the target class name of the given association.
getFieldMapping ( string $fieldName ) : array Gets the mapping of a field.
getFieldNames ( ) : array A numerically indexed list of field names of this persistent class.
getFieldValue ( object $document, string $field ) Gets the specified field's value off the given document.
getIdentifier ( ) : string Gets the mapped identifier field of this class.
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.
getName ( ) : string The name of this Document class.
getNamespace ( ) : string The namespace this Document class belongs to.
getReflectionClass ( ) : ReflectionClas\ReflectionClass Gets the ReflectionClass instance of the mapped class.
getReflectionProperties ( ) : array Gets the ReflectionPropertys of the mapped class.
getReflectionProperty ( string $name ) : ReflectionPropert\ReflectionProperty Gets a ReflectionProperty for a specific field of the mapped class.
getTypeOfField ( string $fieldName ) : Type Gets the type of a field.
hasAssociation ( string $fieldName ) : boolean Checks if the given field is a mapped association for this class.
hasField ( $fieldName ) : boolean Checks whether the class has a (mapped) field with a certain name.
initializeReflection ( Doctrine\Common\Persistence\Mapping\ReflectionService $reflService ) : void Initializes a new ClassMetadata instance that will hold the object-relational mapping metadata of the class with the given name.
isAssociationInverseSide ( $assocName ) {@inheritDoc}
isCollectionValuedAssociation ( $name )
isIdentifier ( string $fieldName ) : boolean Checks whether a field is part of the identifier/primary key field(s).
isInheritedAssociation ( $field )
isInheritedField ( $field )
isSingleValuedAssociation ( string $fieldName ) : boolean Checks if the given field is a mapped single valued association for this class.
mapAttachments ( string $fieldName ) Set the field that will contain attachments of this document.
mapEmbedded ( array $mapping ) Map an embedded object
mapField ( array $mapping ) Map a field.
mapManyToMany ( $mapping )
mapManyToOne ( $mapping )
markInheritanceRoot ( )
newInstance ( ) : object Creates a new instance of the mapped class, without invoking the constructor.
setCustomRepositoryClass ( 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.
setParentClasses ( $classes )
wakeupReflection ( $reflService ) Restores some state that can not be serialized/unserialized.

보호된 메소드들

메소드 설명
validateAndCompleteAssociationMapping ( $mapping )
validateAndCompleteFieldMapping ( $mapping )
validateAndCompleteReferenceMapping ( $mapping )

비공개 메소드들

메소드 설명
checkAndStoreIndexMapping ( $mapping )
storeAssociationMapping ( $mapping )

메소드 상세

__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.

__sleep() 공개 메소드

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)
public __sleep ( ) : array
리턴 array The names of all the fields that should be serialized.

deriveChildMetadata() 공개 메소드

Used to derive a class metadata of the current instance for a mapped child class.
public deriveChildMetadata ( ClassMetadata $child )
$child ClassMetadata

getAssociationMappedByTargetField() 공개 메소드

{@inheritDoc}
public getAssociationMappedByTargetField ( $assocName )

getAssociationNames() 공개 메소드

This array includes identifier associations if present on this class.
public getAssociationNames ( ) : array
리턴 array

getAssociationTargetClass() 공개 메소드

Returns the target class name of the given association.
public getAssociationTargetClass ( string $assocName ) : string
$assocName string
리턴 string

getFieldMapping() 공개 메소드

Gets the mapping of a field.
public getFieldMapping ( string $fieldName ) : array
$fieldName string The field name.
리턴 array The field mapping.

getFieldNames() 공개 메소드

This array includes identifier fields if present on this class.
public getFieldNames ( ) : array
리턴 array

getFieldValue() 공개 메소드

Gets the specified field's value off the given document.
public getFieldValue ( object $document, string $field )
$document object
$field string

getIdentifier() 공개 메소드

Gets the mapped identifier field of this class.
public getIdentifier ( ) : string
리턴 string $identifier

getIdentifierFieldNames() 공개 메소드

Since CouchDB only allows exactly one identifier field this is a proxy to {@see \getIdentifier()} and returns an array.
public getIdentifierFieldNames ( ) : array
리턴 array

getIdentifierValue() 공개 메소드

Gets the document identifier.
public getIdentifierValue ( object $document ) : string
$document object
리턴 string $id

getIdentifierValues() 공개 메소드

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.
public getIdentifierValues ( object $document ) : array
$document object
리턴 array

getName() 공개 메소드

The name of this Document class.
public getName ( ) : string
리턴 string $name The Document class name.

getNamespace() 공개 메소드

The namespace this Document class belongs to.
public getNamespace ( ) : string
리턴 string $namespace The namespace name.

getReflectionClass() 공개 메소드

Gets the ReflectionClass instance of the mapped class.
public getReflectionClass ( ) : ReflectionClas\ReflectionClass
리턴 ReflectionClas\ReflectionClass

getReflectionProperties() 공개 메소드

Gets the ReflectionPropertys 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 ) : ReflectionPropert\ReflectionProperty
$name string
리턴 ReflectionPropert\ReflectionProperty

getTypeOfField() 공개 메소드

Gets the type of a field.
public getTypeOfField ( string $fieldName ) : Type
$fieldName string
리턴 Type

hasAssociation() 공개 메소드

Checks if the given field is a mapped association for this class.
public hasAssociation ( string $fieldName ) : boolean
$fieldName string
리턴 boolean

hasField() 공개 메소드

Checks whether the class has a (mapped) field with a certain name.
public hasField ( $fieldName ) : boolean
$fieldName
리턴 boolean

initializeReflection() 공개 메소드

Initializes a new ClassMetadata instance that will hold the object-relational mapping metadata of the class with the given name.
public initializeReflection ( Doctrine\Common\Persistence\Mapping\ReflectionService $reflService ) : void
$reflService Doctrine\Common\Persistence\Mapping\ReflectionService The reflection service.
리턴 void

isAssociationInverseSide() 공개 메소드

{@inheritDoc}
public isAssociationInverseSide ( $assocName )

isCollectionValuedAssociation() 공개 메소드

isIdentifier() 공개 메소드

Checks whether a field is part of the identifier/primary key field(s).
public isIdentifier ( string $fieldName ) : boolean
$fieldName string The field name
리턴 boolean TRUE if the field is part of the table identifier/primary key field(s), FALSE otherwise.

isInheritedAssociation() 공개 메소드

public isInheritedAssociation ( $field )

isInheritedField() 공개 메소드

public isInheritedField ( $field )

isSingleValuedAssociation() 공개 메소드

Checks if the given field is a mapped single valued association for this class.
public isSingleValuedAssociation ( string $fieldName ) : boolean
$fieldName string
리턴 boolean

mapAttachments() 공개 메소드

Set the field that will contain attachments of this document.
public mapAttachments ( string $fieldName )
$fieldName string

mapEmbedded() 공개 메소드

- 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?
public mapEmbedded ( array $mapping )
$mapping array

mapField() 공개 메소드

- 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?
public mapField ( array $mapping )
$mapping array The mapping information.

mapManyToMany() 공개 메소드

public mapManyToMany ( $mapping )

mapManyToOne() 공개 메소드

public mapManyToOne ( $mapping )

markInheritanceRoot() 공개 메소드

public markInheritanceRoot ( )

newInstance() 공개 메소드

Creates a new instance of the mapped class, without invoking the constructor.
public newInstance ( ) : object
리턴 object

setCustomRepositoryClass() 공개 메소드

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

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

setIdentifier() 공개 메소드

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

setIdentifierValue() 공개 메소드

Sets the document identifier of a document.
public setIdentifierValue ( object $document, mixed $id )
$document object
$id mixed

setParentClasses() 공개 메소드

public setParentClasses ( $classes )

validateAndCompleteAssociationMapping() 보호된 메소드

protected validateAndCompleteAssociationMapping ( $mapping )

validateAndCompleteFieldMapping() 보호된 메소드

protected validateAndCompleteFieldMapping ( $mapping )

validateAndCompleteReferenceMapping() 보호된 메소드

protected validateAndCompleteReferenceMapping ( $mapping )

wakeupReflection() 공개 메소드

Restores some state that can not be serialized/unserialized.
public wakeupReflection ( $reflService )

프로퍼티 상세

$alsoLoadMethods 공개적으로 프로퍼티

READ-ONLY: Array of fields to also load with a given method.
public array $alsoLoadMethods
리턴 array

$associationsMappings 공개적으로 프로퍼티

READ-ONLY
public array $associationsMappings
리턴 array

$attachmentDeclaredClass 공개적으로 프로퍼티

If in an inheritance scenario the attachment field is on a super class, this is its name.
public string|null $attachmentDeclaredClass
리턴 string | null

$attachmentField 공개적으로 프로퍼티

Field that stores the attachments as a key->value array of file-names to attachment objects.
public string $attachmentField
리턴 string

$customRepositoryClassName 공개적으로 프로퍼티

(Optional).
public string $customRepositoryClassName
리턴 string

$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

$hasAttachments 공개적으로 프로퍼티

public bool $hasAttachments
리턴 boolean

$idGenerator 공개적으로 프로퍼티

public $idGenerator

$identifier 공개적으로 프로퍼티

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

$inInheritanceHierachy 공개적으로 프로퍼티

READ-ONLY: Is this entity in an inheritance hierachy?
public $inInheritanceHierachy

$indexed 공개적으로 프로퍼티

Is this class indexed? If yes, then a findAll() query can be executed for this type.
public bool $indexed
리턴 boolean

$indexes 공개적으로 프로퍼티

An array of indexed fields, accessible through a generic view shipped with Doctrine.
public array $indexes
리턴 array

$isEmbeddedDocument 공개적으로 프로퍼티

READ-ONLY: Whether this class describes the mapping of a embedded document.
public bool $isEmbeddedDocument
리턴 boolean

$isMappedSuperclass 공개적으로 프로퍼티

READ-ONLY: Whether this class describes the mapping of a mapped superclass.
public bool $isMappedSuperclass
리턴 boolean

$isReadOnly 공개적으로 프로퍼티

This should be set to true for value objects, for example attachments. Replacing the reference with a new value object will trigger an update.
public bool $isReadOnly
리턴 boolean

$isVersioned 공개적으로 프로퍼티

CouchDB documents are always versioned, this flag determines if this version is exposed to the userland.
public bool $isVersioned
리턴 boolean

$jsonNames 공개적으로 프로퍼티

An array of json result-key-names to field-names
public array $jsonNames
리턴 array

$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: a list of all parent classes.
public $parentClasses

$reflClass 공개적으로 프로퍼티

The ReflectionClass instance of the mapped class.
public ReflectionClass,ReflectionClas $reflClass
리턴 ReflectionClas\ReflectionClass

$reflFields 공개적으로 프로퍼티

The ReflectionProperty instances of the mapped class.
public array $reflFields
리턴 array

$rootDocumentName 공개적으로 프로퍼티

READ-ONLY: The root document class name.
public $rootDocumentName

$versionField 공개적으로 프로퍼티

Version Field stores the CouchDB Revision
public string $versionField
리턴 string