PHP 클래스 Doctrine\OXM\Mapping\ClassMetadataInfo

부터: 2.0
저자: Richard Fullmer ([email protected])
상속: implements Doctrine\Common\Persistence\Mapping\ClassMetadata
파일 보기 프로젝트 열기: doctrine/oxm 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$changeTrackingPolicy integer READ-ONLY: The policy used for change-tracking on entities of this class.
$customRepositoryClassName string (Optional).
$fieldMappings array The mapping definition array supports the following keys: - fieldName (string) The name of the field in the entity this mapping is associated with - id (boolean, optional) Marks this field as the identifier for this class. Used for references - type (string) The type of the field being mapped by this field mapping. Can by any of the allowed Doctrine/OXM/Types or a specific Class name. If used with collection=true, this will assume that each collection object is of the specified type. - xmlName (string, optional) The name of the xml node this class definition will be mapped to. - xmlNode (string) The type of xml object to map this field. Can be one of ('element', 'attribute', or 'text') - required (boolean, optional) Defines if this field is required or not. Checked during marshalling and unmarshalling. - nullable (boolean, optional) Defines if this field is required to be marshalled/unmarshalled if null. - getMethod (string, optional) Defines an optional get method name to use while getting and setting this field on the owning object. - setMethod (string, optional) Defines an optional set method name to use while getting and setting this field on the owning object. - collection (boolean, optional) Define the field as a "collection". This allows for the field to be an array of the above specified type. - direct (boolean, optional, defaults to true) Allow Doctrine OXM to access this field on the class with direct access.
$generatorType integer READ-ONLY: The Id generator type used by the class.
$idGenerator Doctrine\OXM\Id\AbstractIdGenerator READ-ONLY: The ID generator used for generating IDs for this class.
$identifier READ-ONLY: The field name of the class identifier.
$isMappedSuperclass boolean READ-ONLY: Whether this class describes the mapping of a mapped superclass.
$isRoot boolean READ-ONLY: Whether this class describes the mapping xml root element.
$lifecycleCallbacks array READ-ONLY: The registered lifecycle callbacks for entities of this class.
$name string The name of the class
$parentClasses array READ-ONLY: The names of the parent classes (ancestors).
$reflClass ReflectionClass The ReflectionClass instance of the mapped class.
$rootXmlEntityName string READ-ONLY: The name of the entity class that is at the root of the mapped entity inheritance hierarchy. If the entity is not part of a mapped inheritance hierarchy this is the same as {@link $entityName}.
$xmlFieldMap array Mapping xml node names back to class fields keys are xml names
$xmlName string The xml node name to map this class to
$xmlNamespaces array The mapping definition array supports the following keys - url (required) The url containing this namespace definition. Only one URL can be present within the class which does not have a prefix. One can have any number of prefixed URL's. - prefix (optional) The prefix used by this namespace. Prefixes must be unique.

공개 메소드들

메소드 설명
__construct ( string $entityName ) Initializes a new ClassMetadata instance that will hold the object-xml mapping metadata of the class with the given name.
addInheritedFieldMapping ( array $fieldMapping ) INTERNAL: Adds a field mapping without completing/validating it.
addLifecycleCallback ( string $callback, string $event ) Adds a lifecycle callback for entities of this class.
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 (regular) field that holds some data but not a reference to another object.
getFieldMappings ( ) : array Returns an array of all field mappings
getFieldName ( string $xmlName ) : string Gets the field name for a xml name.
getFieldNames ( ) : array A numerically indexed list of field names of this persistent class.
getFieldXmlName ( $fieldName )
getFieldXmlNode ( $fieldName ) : string Gets the type of an xml name.
getIdentifier ( ) : string Gets the mapped identifier field of this class.
getName ( ) : string The name of this XmlEntity class.
getParentClasses ( ) : array
getReflectionClass ( ) : ReflectionClass Gets the ReflectionClass instance of the mapped class.
getTypeOfField ( string $fieldName ) : string Gets the type of a field.
getXmlName ( ) : string Gets the xml node name used to map this class to an xml node
getXmlNamespaces ( ) : array
getXmlNodeTypes ( ) : array Returns all bind xml node types
hasAssociation ( string $fieldName ) : boolean Checks whether the class has a mapped association (embed or reference) with the given field name.
hasField ( $fieldName ) : boolean Checks whether the class has a (mapped) field with a certain name.
hasFieldWrapping ( $fieldName ) : boolean
hasLifecycleCallbacks ( string $lifecycleEvent ) : boolean Whether the class has any attached lifecycle listeners or callbacks for a lifecycle event.
hasReference ( string $fieldName ) : boolean Checks whether the class has a mapped association with the given field name.
hasXmlField ( $xmlName ) : boolean
invokeLifecycleCallbacks ( $lifecycleEvent, XmlEntity $entity, array $arguments = null ) Dispatches the lifecycle event of the given entity to the registered lifecycle callbacks and lifecycle listeners.
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".
isCollection ( $fieldName ) : boolean
isCollectionValuedAssociation ( string $fieldName ) : boolean Checks whether the class has a mapped reference or embed for the specified field and is a single valued association.
isDirect ( $fieldName ) : boolean
isIdGeneratorAuto ( ) : boolean Checks whether the class will generate a new \XmlId 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 ( string $fieldName ) : boolean Checks whether a field is part of the identifier/primary key field(s).
isInheritedField ( $fieldName ) : boolean Checks whether a mapped field is inherited from an entity superclass.
isNullable ( string $fieldName ) : boolean
isRequired ( $fieldName ) : boolean
isSingleValuedAssociation ( string $fieldName ) : boolean Checks whether the class has a mapped reference or embed for the specified field and is a single valued association.
mapField ( array $mapping ) : void
setChangeTrackingPolicy ( integer $policy ) Sets the change tracking policy used by this class.
setCustomRepositoryClass ( $repositoryClassName ) Registers a custom repository class for the document class.
setIdGenerator ( AbstractIdGenerator $generator ) Sets the ID generator used to generate IDs for instances of this class.
setIdGeneratorType ( $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.
setLifecycleCallbacks ( array $callbacks ) Sets the lifecycle callbacks for entities of this class.
setName ( string $entityName )
setParentClasses ( array $classNames ) Sets the parent class names.
setXmlName ( $xmlName ) : string Set the xml node name to be used by this class mapping
setXmlNamespaces ( array $xmlNamespaces ) : void

보호된 메소드들

메소드 설명
inferGetter ( string $fieldName ) : string
inferSetter ( string $fieldName ) : string

메소드 상세

__construct() 공개 메소드

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

addInheritedFieldMapping() 공개 메소드

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

addLifecycleCallback() 공개 메소드

Note: If the same callback is registered more than once, the old one will be overridden.
public addLifecycleCallback ( string $callback, string $event )
$callback string
$event string

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 (regular) field that holds some data but not a reference to another object.
public getFieldMapping ( string $fieldName ) : array
$fieldName string The field name.
리턴 array The field mapping.

getFieldMappings() 공개 메소드

Returns an array of all field mappings
public getFieldMappings ( ) : array
리턴 array

getFieldName() 공개 메소드

If no field name can be found the xml name is returned.
public getFieldName ( string $xmlName ) : string
$xmlName string xml name
리턴 string field name

getFieldNames() 공개 메소드

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

getFieldXmlName() 공개 메소드

public getFieldXmlName ( $fieldName )

getFieldXmlNode() 공개 메소드

Gets the type of an xml name.
public getFieldXmlNode ( $fieldName ) : string
리턴 string one of ("node", "attribute", "text")

getIdentifier() 공개 메소드

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

getName() 공개 메소드

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

getParentClasses() 공개 메소드

public getParentClasses ( ) : array
리턴 array

getReflectionClass() 공개 메소드

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

getTypeOfField() 공개 메소드

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

getXmlName() 공개 메소드

Gets the xml node name used to map this class to an xml node
public getXmlName ( ) : string
리턴 string

getXmlNamespaces() 공개 메소드

public getXmlNamespaces ( ) : array
리턴 array

getXmlNodeTypes() 공개 정적인 메소드

Returns all bind xml node types
public static getXmlNodeTypes ( ) : array
리턴 array

hasAssociation() 공개 메소드

Checks whether the class has a mapped association (embed or reference) with the given field name.
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
리턴 boolean

hasFieldWrapping() 공개 메소드

public hasFieldWrapping ( $fieldName ) : boolean
리턴 boolean

hasLifecycleCallbacks() 공개 메소드

Whether the class has any attached lifecycle listeners or callbacks for a lifecycle event.
public hasLifecycleCallbacks ( string $lifecycleEvent ) : boolean
$lifecycleEvent string
리턴 boolean

hasReference() 공개 메소드

Checks whether the class has a mapped association with the given field name.
public hasReference ( string $fieldName ) : boolean
$fieldName string
리턴 boolean

hasXmlField() 공개 메소드

public hasXmlField ( $xmlName ) : boolean
리턴 boolean

inferGetter() 보호된 메소드

protected inferGetter ( string $fieldName ) : string
$fieldName string
리턴 string

inferSetter() 보호된 메소드

protected inferSetter ( string $fieldName ) : string
$fieldName string
리턴 string

invokeLifecycleCallbacks() 공개 메소드

Dispatches the lifecycle event of the given entity to the registered lifecycle callbacks and lifecycle listeners.
public invokeLifecycleCallbacks ( $lifecycleEvent, XmlEntity $entity, array $arguments = null )
$entity XmlEntity The XmlEntity on which the event occured.
$arguments array

isChangeTrackingDeferredExplicit() 공개 메소드

Whether the change tracking policy of this class is "deferred explicit".

isChangeTrackingDeferredImplicit() 공개 메소드

Whether the change tracking policy of this class is "deferred implicit".

isChangeTrackingNotify() 공개 메소드

Whether the change tracking policy of this class is "notify".
public isChangeTrackingNotify ( ) : boolean
리턴 boolean

isCollection() 공개 메소드

public isCollection ( $fieldName ) : boolean
리턴 boolean

isCollectionValuedAssociation() 공개 메소드

Checks whether the class has a mapped reference or embed for the specified field and is a single valued association.
public isCollectionValuedAssociation ( string $fieldName ) : boolean
$fieldName string
리턴 boolean TRUE if the association exists and is single-valued, FALSE otherwise.

isDirect() 공개 메소드

public isDirect ( $fieldName ) : boolean
리턴 boolean

isIdGeneratorAuto() 공개 메소드

Checks whether the class will generate a new \XmlId 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() 공개 메소드

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.

isInheritedField() 공개 메소드

Checks whether a mapped field is inherited from an entity superclass.
public isInheritedField ( $fieldName ) : boolean
리턴 boolean TRUE if the field is inherited, FALSE otherwise.

isNullable() 공개 메소드

public isNullable ( string $fieldName ) : boolean
$fieldName string
리턴 boolean

isRequired() 공개 메소드

public isRequired ( $fieldName ) : 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 ( string $fieldName ) : boolean
$fieldName string
리턴 boolean TRUE if the association exists and is single-valued, FALSE otherwise.

mapField() 공개 메소드

public mapField ( array $mapping ) : void
$mapping array
리턴 void

setChangeTrackingPolicy() 공개 메소드

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

setCustomRepositoryClass() 공개 메소드

Registers a custom repository class for the document class.
public setCustomRepositoryClass ( $repositoryClassName )

setIdGenerator() 공개 메소드

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

setIdGeneratorType() 공개 메소드

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

setIdentifier() 공개 메소드

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

setLifecycleCallbacks() 공개 메소드

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

setName() 공개 메소드

public setName ( string $entityName )
$entityName string

setParentClasses() 공개 메소드

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

setXmlName() 공개 메소드

Set the xml node name to be used by this class mapping
public setXmlName ( $xmlName ) : string
리턴 string

setXmlNamespaces() 공개 메소드

public setXmlNamespaces ( array $xmlNamespaces ) : void
$xmlNamespaces array
리턴 void

프로퍼티 상세

$changeTrackingPolicy 공개적으로 프로퍼티

READ-ONLY: The policy used for change-tracking on entities of this class.
public int $changeTrackingPolicy
리턴 integer

$customRepositoryClassName 공개적으로 프로퍼티

(Optional).
public string $customRepositoryClassName
리턴 string

$fieldMappings 공개적으로 프로퍼티

The mapping definition array supports the following keys: - fieldName (string) The name of the field in the entity this mapping is associated with - id (boolean, optional) Marks this field as the identifier for this class. Used for references - type (string) The type of the field being mapped by this field mapping. Can by any of the allowed Doctrine/OXM/Types or a specific Class name. If used with collection=true, this will assume that each collection object is of the specified type. - xmlName (string, optional) The name of the xml node this class definition will be mapped to. - xmlNode (string) The type of xml object to map this field. Can be one of ('element', 'attribute', or 'text') - required (boolean, optional) Defines if this field is required or not. Checked during marshalling and unmarshalling. - nullable (boolean, optional) Defines if this field is required to be marshalled/unmarshalled if null. - getMethod (string, optional) Defines an optional get method name to use while getting and setting this field on the owning object. - setMethod (string, optional) Defines an optional set method name to use while getting and setting this field on the owning object. - collection (boolean, optional) Define the field as a "collection". This allows for the field to be an array of the above specified type. - direct (boolean, optional, defaults to true) Allow Doctrine OXM to access this field on the class with direct access.
public array $fieldMappings
리턴 array

$generatorType 공개적으로 프로퍼티

READ-ONLY: The Id generator type used by the class.
public int $generatorType
리턴 integer

$idGenerator 공개적으로 프로퍼티

READ-ONLY: The ID generator used for generating IDs for this class.
public AbstractIdGenerator,Doctrine\OXM\Id $idGenerator
리턴 Doctrine\OXM\Id\AbstractIdGenerator

$identifier 공개적으로 프로퍼티

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

$isMappedSuperclass 공개적으로 프로퍼티

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

$isRoot 공개적으로 프로퍼티

READ-ONLY: Whether this class describes the mapping xml root element.
public bool $isRoot
리턴 boolean

$lifecycleCallbacks 공개적으로 프로퍼티

READ-ONLY: The registered lifecycle callbacks for entities of this class.
public array $lifecycleCallbacks
리턴 array

$name 공개적으로 프로퍼티

The name of the class
public string $name
리턴 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

$rootXmlEntityName 공개적으로 프로퍼티

READ-ONLY: The name of the entity class that is at the root of the mapped entity inheritance hierarchy. If the entity is not part of a mapped inheritance hierarchy this is the same as {@link $entityName}.
public string $rootXmlEntityName
리턴 string

$xmlFieldMap 공개적으로 프로퍼티

Mapping xml node names back to class fields keys are xml names
public array $xmlFieldMap
리턴 array

$xmlName 공개적으로 프로퍼티

The xml node name to map this class to
public string $xmlName
리턴 string

$xmlNamespaces 공개적으로 프로퍼티

The mapping definition array supports the following keys - url (required) The url containing this namespace definition. Only one URL can be present within the class which does not have a prefix. One can have any number of prefixed URL's. - prefix (optional) The prefix used by this namespace. Prefixes must be unique.
public array $xmlNamespaces
리턴 array