Doctrine


Doctrine\ORM\Mapping\ClassMetadataInfo
/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 40

Class ClassMetadataInfo

ClassMetadataInfo

public class ClassMetadataInfo

A ClassMetadata instance holds all the object-relational mapping metadata of an entity and it's associations.

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

Author:
Roman Borschel
Jonathan H. Wage
Since:
2.0

Field Summary
final int

CHANGETRACKING_DEFERRED_EXPLICIT

DEFERRED_EXPLICIT means that changes of entities are calculated at commit-time by doing a property-by-property comparison with the original data.

final int

CHANGETRACKING_DEFERRED_IMPLICIT

DEFERRED_IMPLICIT means that changes of entities are calculated at commit-time by doing a property-by-property comparison with the original data.

final int

CHANGETRACKING_NOTIFY

NOTIFY means that Doctrine relies on the entities sending out notifications when their properties change.

final int

GENERATOR_TYPE_AUTO

AUTO means the generator type will depend on what the used platform prefers.

final int

GENERATOR_TYPE_IDENTITY

IDENTITY means an identity column is used for id generation.

final int

GENERATOR_TYPE_NONE

NONE means the class does not have a generated id.

final int

GENERATOR_TYPE_SEQUENCE

SEQUENCE means a separate sequence object will be used.

final int

GENERATOR_TYPE_TABLE

TABLE means a separate table is used for id generation.

final int

INHERITANCE_TYPE_JOINED

JOINED means the class will be persisted according to the rules of Class Table Inheritance.

final int

INHERITANCE_TYPE_NONE

NONE means the class does not participate in an inheritance hierarchy and therefore does not need an inheritance mapping type.

final int

INHERITANCE_TYPE_SINGLE_TABLE

SINGLE_TABLE means the class will be persisted according to the rules of Single Table Inheritance.

final int

INHERITANCE_TYPE_TABLE_PER_CLASS

TABLE_PER_CLASS means the class will be persisted according to the rules of Concrete Table Inheritance.

array

$associationMappings

READ-ONLY: The association mappings of this class.

integer

$changeTrackingPolicy

READ-ONLY: The policy used for change-tracking on entities of this class.

array

$columnNames

READ-ONLY: A map of field names to column names.

string

$customRepositoryClassName

The name of the custom repository class used for the entity class.

array

$discriminatorColumn

READ-ONLY: The definition of the descriminator column used in JOINED and SINGLE_TABLE inheritance mappings.

mixed

$discriminatorMap

READ-ONLY: The discriminator map of all mapped classes in the hierarchy.

mixed

$discriminatorValue

READ-ONLY: The discriminator value of this class.

array

$fieldMappings

READ-ONLY: The field mappings of the class.

array

$fieldNames

READ-ONLY: An array of field names.

string

$generatorType

READ-ONLY: The Id generator type used by the class.

AbstractIdGenerator

$idGenerator

READ-ONLY: The ID generator used for generating IDs for this class.

array

$identifier

READ-ONLY: The field names of all fields that are part of the identifier/primary key of the mapped entity class.

integer

$inheritanceType

READ-ONLY: The inheritance mapping type used by the class.

boolean

$isIdentifierComposite

READ-ONLY: Flag indicating whether the identifier/primary key of the class is composite.

boolean

$isMappedSuperclass

READ-ONLY: Whether this class describes the mapping of a mapped superclass.

boolean $isVersioned

$isVersioned

READ-ONLY: A flag for whether or not instances of this class are to be versioned with optimistic locking.

array

$lifecycleCallbacks

READ-ONLY: The registered lifecycle callbacks for entities of this class.

mixed

$name

READ-ONLY: The name of the entity class.

string

$namespace

READ-ONLY: The namespace the entity class is contained in.

array

$parentClasses

READ-ONLY: The names of the parent classes (ancestors).

string

$rootEntityName

READ-ONLY: The name of the entity class that is at the root of the mapped entity inheritance hierarchy.

array

$sequenceGeneratorDefinition

READ-ONLY: The definition of the sequence generator of this class.

array

$subClasses

READ-ONLY: The names of all subclasses (descendants).

array

$table

READ-ONLY: The primary table definition.

array

$tableGeneratorDefinition

READ-ONLY: The definition of the table generator of this class.

mixed $versionField

$versionField

READ-ONLY: The name of the field which is used for versioning in optimistic locking (if any).

Constructor Summary

ClassMetadataInfo(string entityName)

Initializes a new ClassMetadata instance that will hold the object-relational mapping metadata of the class with the given name.

Method Summary
void

addInheritedAssociationMapping(AssociationMapping mapping, string owningClassName)

INTERNAL: Adds an association mapping without completing/validating it.

void

addInheritedFieldMapping(mixed fieldMapping, array mapping)

INTERNAL: Adds a field mapping without completing/validating it.

void

addLifecycleCallback(string callback, string event)

Adds a lifecycle callback for entities of this class.

Doctrine\ORM\Mapping\AssociationMapping

getAssociationMapping(string fieldName)

Gets the mapping of an association.

array

getAssociationMappings()

Gets all association mappings of the class.

string

getColumnName(string fieldName)

Gets a column name for a field name.

array

getColumnNames(mixed fieldNames)

Gets an array containing all the column names.

array

getFieldMapping(string fieldName)

Gets the mapping of a (regular) field that holds some data but not a reference to another object.

string

getFieldName(string columnName)

Gets the field name for a column name.

array

getIdentifierColumnNames()

Returns an array with all the identifier column names.

mixed

getIdentifierFieldNames()

Gets the identifier (primary key) field names of the class.

array

getLifecycleCallbacks(string event)

Gets the registered lifecycle callbacks for an event.

string

getSingleIdentifierColumnName()

Gets the column name of the single id column.

string

getSingleIdentifierFieldName()

Gets the name of the single id field.

string

getTableName()

Gets the name of the primary table.

string

getTemporaryIdTableName()

Gets the table name to use for temporary identifier tables of this class.

Doctrine\DBAL\Types\Type

getTypeOfColumn(mixed columnName)

Gets the type of a column.

Doctrine\DBAL\Types\Type

getTypeOfField(string fieldName)

Gets the type of a field.

boolean

hasAssociation(string fieldName)

Checks whether the class has a mapped association with the given field name.

boolean

hasField(mixed fieldName)

Checks whether the class has a (mapped) field with a certain name.

boolean

hasLifecycleCallbacks(string lifecycleEvent)

Whether the class has any attached lifecycle listeners or callbacks for a lifecycle event.

void

invokeLifecycleCallbacks(mixed lifecycleEvent, Entity entity, string event)

Dispatches the lifecycle event of the given entity to the registered lifecycle callbacks and lifecycle listeners.

boolean

isChangeTrackingDeferredExplicit()

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

boolean

isChangeTrackingDeferredImplicit()

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

boolean

isChangeTrackingNotify()

Whether the change tracking policy of this class is "notify".

boolean

isCollectionValuedAssociation(string fieldName)

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

boolean

isIdGeneratorIdentity()

Checks whether the class uses an identity column for the Id generation.

boolean

isIdGeneratorSequence()

Checks whether the class uses a sequence for id generation.

boolean

isIdGeneratorTable()

Checks whether the class uses a table for id generation.

boolean

isIdentifier(string fieldName)

Checks whether a field is part of the identifier/primary key field(s).

boolean

isIdentifierNatural()

Checks whether the class has a natural identifier/pk (which means it does not use any Id generator.

boolean

isInheritanceTypeJoined()

Checks whether the mapped class uses the JOINED inheritance mapping strategy.

boolean

isInheritanceTypeNone()

boolean

isInheritanceTypeSingleTable()

Checks whether the mapped class uses the SINGLE_TABLE inheritance mapping strategy.

boolean

isInheritanceTypeTablePerClass()

Checks whether the mapped class uses the TABLE_PER_CLASS inheritance mapping strategy.

boolean

isInheritedAssociation(string fieldName)

Checks whether a mapped association field is inherited from a superclass.

boolean

isInheritedField(mixed fieldName)

Checks whether a mapped field is inherited from an entity superclass.

boolean

isNullable(string fieldName)

Check if the field is not null.

boolean

isSingleValuedAssociation(string fieldName)

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

boolean

isUniqueField(string fieldName)

Check if the field is unique.

void

mapField(array mapping)

Adds a mapped field to the class.

void

mapManyToMany(array mapping)

Adds a many-to-many mapping.

void

mapManyToOne(array mapping)

Adds a many-to-one mapping.

void

mapOneToMany(array mapping)

Adds a one-to-many mapping.

void

mapOneToOne(array mapping)

Adds a one-to-one mapping.

void

setChangeTrackingPolicy(integer policy)

Sets the change tracking policy used by this class.

void

setCustomRepositoryClass(mixed repositoryClassName, string mapperClassName)

Registers a custom repository class for the entity class.

void

setDiscriminatorColumn(array columnDef)

Sets the discriminator column definition.

void

setDiscriminatorMap(array map)

Sets the discriminator values used by this class.

void

setIdGenerator(AbstractIdGenerator generator)

Sets the ID generator used to generate IDs for instances of this class.

void

setIdGeneratorType(mixed generatorType)

Sets the type of Id generator to use for the mapped class.

void

setIdentifier(array identifier)

INTERNAL: Sets the mapped identifier/primary key fields of this class.

void

setInheritanceType(integer type)

Sets the inheritance type used by the class and it's subclasses.

void

setLifecycleCallbacks(array callbacks)

Sets the lifecycle callbacks for entities of this class.

void

setParentClasses(mixed classNames)

Sets the parent class names.

void

setPrimaryTable(array primaryTableDefinition)

Sets the primary table definition.

void

setSequenceGeneratorDefinition(array definition)

Sets the definition of the sequence ID generator for this class.

void

setSubclasses(array subclasses)

Sets the mapped subclasses of this class.

void

setTableName(string tableName)

Sets the name of the primary table the class is mapped to.

void

setVersionField(string versionField)

Sets the name of the field that is to be used for versioning if this class is versioned for optimistic locking.

void

setVersionMapping(array mapping)

Sets the version field mapping used for versioning.

void

setVersioned(boolean bool)

Sets whether this class is to be versioned for optimistic locking.

boolean

usesIdGenerator()

Checks whether the mapped class uses an Id generator.

Field Detail

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 106

CHANGETRACKING_DEFERRED_EXPLICIT

public final int CHANGETRACKING_DEFERRED_EXPLICIT = 2

DEFERRED_EXPLICIT means that changes of entities are calculated at commit-time by doing a property-by-property comparison with the original data. This will be done only for entities that were explicitly saved (through persist() or a cascade).


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 100

CHANGETRACKING_DEFERRED_IMPLICIT

public final int CHANGETRACKING_DEFERRED_IMPLICIT = 1

DEFERRED_IMPLICIT means that changes of entities are calculated at commit-time by doing a property-by-property comparison with the original data. This will be done for all entities that are in MANAGED state at commit-time.

This is the default change tracking policy.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 112

CHANGETRACKING_NOTIFY

public final int CHANGETRACKING_NOTIFY = 3

NOTIFY means that Doctrine relies on the entities sending out notifications when their properties change. Such entity classes must implement the NotifyPropertyChanged interface.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 69

GENERATOR_TYPE_AUTO

public final int GENERATOR_TYPE_AUTO = 1

AUTO means the generator type will depend on what the used platform prefers. Offers full portability.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 87

GENERATOR_TYPE_IDENTITY

public final int GENERATOR_TYPE_IDENTITY = 4

IDENTITY means an identity column is used for id generation. The database will fill in the id column on insertion. Platforms that do not support native identity columns may emulate them. Full portability is currently not guaranteed.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 92

GENERATOR_TYPE_NONE

public final int GENERATOR_TYPE_NONE = 5

NONE means the class does not have a generated id. That means the class must have a natural, manually assigned id.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 75

GENERATOR_TYPE_SEQUENCE

public final int GENERATOR_TYPE_SEQUENCE = 2

SEQUENCE means a separate sequence object will be used. Platforms that do not have native sequence support may emulate it. Full portability is currently not guaranteed.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 80

GENERATOR_TYPE_TABLE

public final int GENERATOR_TYPE_TABLE = 3

TABLE means a separate table is used for id generation. Offers full portability.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 52

INHERITANCE_TYPE_JOINED

public final int INHERITANCE_TYPE_JOINED = 2

JOINED means the class will be persisted according to the rules of Class Table Inheritance.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 47

INHERITANCE_TYPE_NONE

public final int INHERITANCE_TYPE_NONE = 1

NONE means the class does not participate in an inheritance hierarchy and therefore does not need an inheritance mapping type.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 57

INHERITANCE_TYPE_SINGLE_TABLE

public final int INHERITANCE_TYPE_SINGLE_TABLE = 3

SINGLE_TABLE means the class will be persisted according to the rules of Single Table Inheritance.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 62

INHERITANCE_TYPE_TABLE_PER_CLASS

public final int INHERITANCE_TYPE_TABLE_PER_CLASS = 4

TABLE_PER_CLASS means the class will be persisted according to the rules of Concrete Table Inheritance.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 305

associationMappings

public array $associationMappings = array()

READ-ONLY: The association mappings of this class.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 352

changeTrackingPolicy

public integer $changeTrackingPolicy = self::CHANGETRACKING_DEFERRED_IMPLICIT

READ-ONLY: The policy used for change-tracking on entities of this class.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 247

columnNames

public array $columnNames = array()

READ-ONLY: A map of field names to column names. Keys are field names and values column names. Used to look up column names from field names. This is the reverse lookup map of $_fieldNames.

Todo:
We could get rid of this array by just using $fieldMappings[$fieldName]['columnName'].

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 142

customRepositoryClassName

public string $customRepositoryClassName

The name of the custom repository class used for the entity class. (Optional).


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 277

discriminatorColumn

public array $discriminatorColumn

READ-ONLY: The definition of the descriminator column used in JOINED and SINGLE_TABLE inheritance mappings.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 269

discriminatorMap

public mixed $discriminatorMap = array()

READ-ONLY: The discriminator map of all mapped classes in the hierarchy.

This does only apply to the JOINED and SINGLE_TABLE inheritance mapping strategies where a discriminator column is used.

See Also:
discriminatorColumn

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 258

discriminatorValue

public mixed $discriminatorValue

READ-ONLY: The discriminator value of this class.

This does only apply to the JOINED and SINGLE_TABLE inheritance mapping strategies where a discriminator column is used.

See Also:
discriminatorColumn

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 228

fieldMappings

public array $fieldMappings = array()

READ-ONLY: The field mappings of the class. 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 Entity.

- type (string) The type name of the mapped field. Can be one of Doctrine's mapping types or a custom mapping type.

- columnName (string, optional) The column name. Optional. Defaults to the field name.

- length (integer, optional) The database length of the column. Optional. Default value taken from the type.

- id (boolean, optional) Marks the field as the primary key of the entity. Multiple fields of an entity can have the id attribute, forming a composite key.

- nullable (boolean, optional) Whether the column is nullable. Defaults to FALSE.

- columnDefinition (string, optional, schema-only) The SQL fragment that is used when generating the DDL for the column.

- precision (integer, optional, schema-only) The precision of a decimal column. Only valid if the column type is decimal.

- scale (integer, optional, schema-only) The scale of a decimal column. Only valid if the column type is decimal.

- unique (string, optional, schema-only) Whether a unique constraint should be generated for the column.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 237

fieldNames

public array $fieldNames = array()

READ-ONLY: An array of field names. Used to look up field names from column names. Keys are column names and values are field names. This is the reverse lookup map of $_columnNames.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 185

generatorType

public string $generatorType = self::GENERATOR_TYPE_NONE

READ-ONLY: The Id generator type used by the class.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 320

idGenerator

public AbstractIdGenerator $idGenerator

READ-ONLY: The ID generator used for generating IDs for this class.

Todo:
Remove

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 171

identifier

public array $identifier = array()

READ-ONLY: The field names of all fields that are part of the identifier/primary key of the mapped entity class.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 178

inheritanceType

public integer $inheritanceType = self::INHERITANCE_TYPE_NONE

READ-ONLY: The inheritance mapping type used by the class.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 312

isIdentifierComposite

public boolean $isIdentifierComposite = false

READ-ONLY: Flag indicating whether the identifier/primary key of the class is composite.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 149

isMappedSuperclass

public boolean $isMappedSuperclass = false

READ-ONLY: Whether this class describes the mapping of a mapped superclass.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 360

isVersioned

public boolean $isVersioned $isVersioned

READ-ONLY: A flag for whether or not instances of this class are to be versioned with optimistic locking.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 298

lifecycleCallbacks

public array $lifecycleCallbacks = array()

READ-ONLY: The registered lifecycle callbacks for entities of this class.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 117

name

public mixed $name

READ-ONLY: The name of the entity class.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 125

namespace

public string $namespace

READ-ONLY: The namespace the entity class is contained in.

Todo:
Not really needed. Usage could be localized.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 156

parentClasses

public array $parentClasses = array()

READ-ONLY: The names of the parent classes (ancestors).


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 134

rootEntityName

public string $rootEntityName

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 $entityName.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 337

sequenceGeneratorDefinition

public array $sequenceGeneratorDefinition

READ-ONLY: The definition of the sequence generator of this class. Only used for the SEQUENCE generation strategy.

The definition has the following structure: array( 'sequenceName' => 'name', 'allocationSize' => 20, 'initialValue' => 1 )


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 163

subClasses

public array $subClasses = array()

READ-ONLY: The names of all subclasses (descendants).


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 291

table

public array $table

READ-ONLY: The primary table definition. The definition is an array with the following entries:

name => schema => indexes => array uniqueConstraints => array

Todo:
Rename to just $table

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 345

tableGeneratorDefinition

public array $tableGeneratorDefinition

READ-ONLY: The definition of the table generator of this class. Only used for the TABLE generation strategy.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 367

versionField

public mixed $versionField $versionField

READ-ONLY: The name of the field which is used for versioning in optimistic locking (if any).


Constructor Detail

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 375

ClassMetadataInfo

public ClassMetadataInfo(string entityName)

Initializes a new ClassMetadata instance that will hold the object-relational mapping metadata of the class with the given name.

Parameters:
entityName - The name of the entity class the new instance is used for.

Method Detail

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 957

addInheritedAssociationMapping

public void addInheritedAssociationMapping(AssociationMapping mapping, string owningClassName)

INTERNAL: Adds an association mapping without completing/validating it. This is mainly used to add inherited association mappings to derived classes.

Parameters:
owningClassName - The name of the class that defined this mapping.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 973

addInheritedFieldMapping

public void addInheritedFieldMapping(mixed fieldMapping, array mapping)

INTERNAL: Adds a field mapping without completing/validating it. This is mainly used to add inherited field mappings to derived classes.

Todo:
Rename: addInheritedFieldMapping

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 1096

addLifecycleCallback

public void addLifecycleCallback(string callback, string event)

Adds a lifecycle callback for entities of this class.

Note: If the same callback is registered more than once, the old one will be overridden.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 502

getAssociationMapping

public Doctrine\ORM\Mapping\AssociationMapping getAssociationMapping(string fieldName)

Gets the mapping of an association.

Parameters:
fieldName - The field name that represents the association in the object model.
Returns:
The mapping.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 515

getAssociationMappings

public array getAssociationMappings()

Gets all association mappings of the class.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 474

getColumnName

public string getColumnName(string fieldName)

Gets a column name for a field name. If the column name for the field cannot be found, the given field name is returned.

Parameters:
fieldName - The field name.
Returns:
The column name.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 643

getColumnNames

public array getColumnNames(mixed fieldNames)

Gets an array containing all the column names.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 487

getFieldMapping

public array getFieldMapping(string fieldName)

Gets the mapping of a (regular) field that holds some data but not a reference to another object.

Parameters:
fieldName - The field name.
Returns:
The field mapping.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 527

getFieldName

public string getFieldName(string columnName)

Gets the field name for a column name. If no field name can be found the column name is returned.

Parameters:
columnName - column name
Returns:
column alias

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 661

getIdentifierColumnNames

public array getIdentifierColumnNames()

Returns an array with all the identifier column names.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 584

getIdentifierFieldNames

public mixed getIdentifierFieldNames()

Gets the identifier (primary key) field names of the class.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 1082

getLifecycleCallbacks

public array getLifecycleCallbacks(string event)

Gets the registered lifecycle callbacks for an event.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 611

getSingleIdentifierColumnName

public string getSingleIdentifierColumnName()

Gets the column name of the single id column. Note that this only works on entity classes that have a single-field pk.

Throws:
If the class has a composite primary key.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 596

getSingleIdentifierFieldName

public string getSingleIdentifierFieldName()

Gets the name of the single id field. Note that this only works on entity classes that have a single-field pk.

Throws:
If the class has a composite primary key.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 801

getTableName

public string getTableName()

Gets the name of the primary table.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 811

getTemporaryIdTableName

public string getTemporaryIdTableName()

Gets the table name to use for temporary identifier tables of this class.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 791

getTypeOfColumn

public Doctrine\DBAL\Types\Type getTypeOfColumn(mixed columnName)

Gets the type of a column.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 780

getTypeOfField

public Doctrine\DBAL\Types\Type getTypeOfField(string fieldName)

Gets the type of a field.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 1167

hasAssociation

public boolean hasAssociation(string fieldName)

Checks whether the class has a mapped association with the given field name.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 633

hasField

public boolean hasField(mixed fieldName)

Checks whether the class has a (mapped) field with a certain name.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 1071

hasLifecycleCallbacks

public boolean hasLifecycleCallbacks(string lifecycleEvent)

Whether the class has any attached lifecycle listeners or callbacks for a lifecycle event.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 1058

invokeLifecycleCallbacks

public void invokeLifecycleCallbacks(mixed lifecycleEvent, Entity entity, string event)

Dispatches the lifecycle event of the given entity to the registered lifecycle callbacks and lifecycle listeners.

Parameters:
event - The lifecycle event.
entity - The Entity on which the event occured.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 396

isChangeTrackingDeferredExplicit

public boolean isChangeTrackingDeferredExplicit()

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


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 406

isChangeTrackingDeferredImplicit

public boolean isChangeTrackingDeferredImplicit()

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


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 416

isChangeTrackingNotify

public boolean isChangeTrackingNotify()

Whether the change tracking policy of this class is "notify".


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 1192

isCollectionValuedAssociation

public boolean isCollectionValuedAssociation(string fieldName)

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

Returns:
TRUE if the association exists and is collection-valued, FALSE otherwise.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 738

isIdGeneratorIdentity

public boolean isIdGeneratorIdentity()

Checks whether the class uses an identity column for the Id generation.

Returns:
TRUE if the class uses the IDENTITY generator, FALSE otherwise.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 748

isIdGeneratorSequence

public boolean isIdGeneratorSequence()

Checks whether the class uses a sequence for id generation.

Returns:
TRUE if the class uses the SEQUENCE generator, FALSE otherwise.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 758

isIdGeneratorTable

public boolean isIdGeneratorTable()

Checks whether the class uses a table for id generation.

Returns:
TRUE if the class uses the TABLE generator, FALSE otherwise.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 428

isIdentifier

public boolean isIdentifier(string fieldName)

Checks whether a field is part of the identifier/primary key field(s).

Parameters:
fieldName - The field name
Returns:
TRUE if the field is part of the table identifier/primary key field(s), FALSE otherwise.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 769

isIdentifierNatural

public boolean isIdentifierNatural()

Checks whether the class has a natural identifier/pk (which means it does not use any Id generator.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 706

isInheritanceTypeJoined

public boolean isInheritanceTypeJoined()

Checks whether the mapped class uses the JOINED inheritance mapping strategy.

Returns:
TRUE if the class participates in a JOINED inheritance mapping, FALSE otherwise.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 695

isInheritanceTypeNone

public boolean isInheritanceTypeNone()


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 717

isInheritanceTypeSingleTable

public boolean isInheritanceTypeSingleTable()

Checks whether the mapped class uses the SINGLE_TABLE inheritance mapping strategy.

Returns:
TRUE if the class participates in a SINGLE_TABLE inheritance mapping, FALSE otherwise.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 728

isInheritanceTypeTablePerClass

public boolean isInheritanceTypeTablePerClass()

Checks whether the mapped class uses the TABLE_PER_CLASS inheritance mapping strategy.

Returns:
TRUE if the class participates in a TABLE_PER_CLASS inheritance mapping, FALSE otherwise.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 874

isInheritedAssociation

public boolean isInheritedAssociation(string fieldName)

Checks whether a mapped association field is inherited from a superclass.

Returns:
TRUE if the field is inherited, FALSE otherwise.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 863

isInheritedField

public boolean isInheritedField(mixed fieldName)

Checks whether a mapped field is inherited from an entity superclass.

Returns:
TRUE if the field is inherited, FALSE otherwise.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 457

isNullable

public boolean isNullable(string fieldName)

Check if the field is not null.

Parameters:
fieldName - The field name
Returns:
TRUE if the field is not null, FALSE otherwise.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 1179

isSingleValuedAssociation

public boolean isSingleValuedAssociation(string fieldName)

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

Returns:
TRUE if the association exists and is single-valued, FALSE otherwise.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 442

isUniqueField

public boolean isUniqueField(string fieldName)

Check if the field is unique.

Parameters:
fieldName - The field name
Returns:
TRUE if the field is unique, FALSE otherwise.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 940

mapField

public void mapField(array mapping)

Adds a mapped field to the class.

Parameters:
mapping - The field mapping.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 1020

mapManyToMany

public void mapManyToMany(array mapping)

Adds a many-to-many mapping.

Parameters:
mapping - The mapping.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 1009

mapManyToOne

public void mapManyToOne(array mapping)

Adds a many-to-one mapping.

Parameters:
mapping - The mapping.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 997

mapOneToMany

public void mapOneToMany(array mapping)

Adds a one-to-many mapping.

Parameters:
mapping - The mapping.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 985

mapOneToOne

public void mapOneToOne(array mapping)

Adds a one-to-one mapping.

Parameters:
mapping - The mapping.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 386

setChangeTrackingPolicy

public void setChangeTrackingPolicy(integer policy)

Sets the change tracking policy used by this class.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 1046

setCustomRepositoryClass

public void setCustomRepositoryClass(mixed repositoryClassName, string mapperClassName)

Registers a custom repository class for the entity class.

Parameters:
mapperClassName - The class name of the custom mapper.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 1118

setDiscriminatorColumn

public void setDiscriminatorColumn(array columnDef)

Sets the discriminator column definition.

See Also:
getDiscriminatorColumn()

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 1141

setDiscriminatorMap

public void setDiscriminatorMap(array map)

Sets the discriminator values used by this class. Used for JOINED and SINGLE_TABLE inheritance mapping strategies.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 1203

setIdGenerator

public void setIdGenerator(AbstractIdGenerator generator)

Sets the ID generator used to generate IDs for instances of this class.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 677

setIdGeneratorType

public void setIdGeneratorType(mixed generatorType)

Sets the type of Id generator to use for the mapped class.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 623

setIdentifier

public void setIdentifier(array identifier)

INTERNAL: Sets the mapped identifier/primary key fields of this class. Mainly used by the ClassMetadataFactory to assign inherited identifiers.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 850

setInheritanceType

public void setInheritanceType(integer type)

Sets the inheritance type used by the class and it's subclasses.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 1107

setLifecycleCallbacks

public void setLifecycleCallbacks(array callbacks)

Sets the lifecycle callbacks for entities of this class. Any previously registered callbacks are overwritten.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 837

setParentClasses

public void setParentClasses(mixed classNames)

Sets the parent class names. Assumes that the class names in the passed array are in the order: directParent -> directParentParent -> directParentParentParent ... -> root.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 900

setPrimaryTable

public void setPrimaryTable(array primaryTableDefinition)

Sets the primary table definition. The provided array must have the following structure:

name => schema => catalog =>


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 1222

setSequenceGeneratorDefinition

public void setSequenceGeneratorDefinition(array definition)

Sets the definition of the sequence ID generator for this class.

The definition must have the following structure: array( 'sequenceName' => 'name', 'allocationSize' => 20, 'initialValue' => 1 )


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 821

setSubclasses

public void setSubclasses(array subclasses)

Sets the mapped subclasses of this class.

Parameters:
subclasses - The names of all mapped subclasses.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 885

setTableName

public void setTableName(string tableName)

Sets the name of the primary table the class is mapped to.

Parameters:
tableName - The table name.
Deprecated.

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 1265

setVersionField

public void setVersionField(string versionField)

Sets the name of the field that is to be used for versioning if this class is versioned for optimistic locking.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 1233

setVersionMapping

public void setVersionMapping(array mapping)

Sets the version field mapping used for versioning. Sets the default value to use depending on the column type.

Parameters:
mapping - The version field mapping array

/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 1254

setVersioned

public void setVersioned(boolean bool)

Sets whether this class is to be versioned for optimistic locking.


/Doctrine/ORM/Mapping/ClassMetadataInfo.php at line 687

usesIdGenerator

public boolean usesIdGenerator()

Checks whether the mapped class uses an Id generator.

Returns:
TRUE if the mapped class uses an Id generator, FALSE otherwise.

Doctrine