class ClassMetadataBuilder (View source)

Builder Object for ClassMetadata

Methods

__construct(ClassMetadataInfo $cm)

No description

getClassMetadata()

No description

setMappedSuperClass()

Marks the class as mapped superclass.

setEmbeddable()

Marks the class as embeddable.

$this
addEmbedded(string $fieldName, string $class, string|null $columnPrefix = null)

Adds and embedded class

setCustomRepositoryClass(string $repositoryClassName)

Sets custom Repository class name.

setReadOnly()

Marks class read only.

setTable(string $name)

Sets the table name.

addIndex(array $columns, string $name)

Adds Index.

addUniqueConstraint(array $columns, string $name)

Adds Unique Constraint.

addNamedQuery(string $name, string $dqlQuery)

Adds named query.

setJoinedTableInheritance()

Sets class as root of a joined table inheritance hierarchy.

setSingleTableInheritance()

Sets class as root of a single table inheritance hierarchy.

setDiscriminatorColumn(string $name, string $type = 'string', int $length = 255)

Sets the discriminator column details.

addDiscriminatorMapClass(string $name, string $class)

Adds a subclass to this inheritance hierarchy.

setChangeTrackingPolicyDeferredExplicit()

Sets deferred explicit change tracking policy.

setChangeTrackingPolicyNotify()

Sets notify change tracking policy.

addLifecycleEvent(string $methodName, string $event)

Adds lifecycle event.

addField(string $name, string $type, array $mapping = [])

Adds Field.

createField(string $name, string $type)

Creates a field builder.

createEmbedded(string $fieldName, string $class)

Creates an embedded builder.

addManyToOne(string $name, string $targetEntity, string|null $inversedBy = null)

Adds a simple many to one association, optionally with the inversed by field.

createManyToOne(string $name, string $targetEntity)

Creates a ManyToOne Association Builder.

createOneToOne(string $name, string $targetEntity)

Creates a OneToOne Association Builder.

addInverseOneToOne(string $name, string $targetEntity, string $mappedBy)

Adds simple inverse one-to-one association.

addOwningOneToOne(string $name, string $targetEntity, string|null $inversedBy = null)

Adds simple owning one-to-one association.

createManyToMany(string $name, string $targetEntity)

Creates a ManyToMany Association Builder.

addOwningManyToMany(string $name, string $targetEntity, string|null $inversedBy = null)

Adds a simple owning many to many association.

addInverseManyToMany(string $name, string $targetEntity, string $mappedBy)

Adds a simple inverse many to many association.

createOneToMany(string $name, string $targetEntity)

Creates a one to many association builder.

addOneToMany(string $name, string $targetEntity, string $mappedBy)

Adds simple OneToMany association.

Details

__construct(ClassMetadataInfo $cm)

Parameters

ClassMetadataInfo $cm

ClassMetadata getClassMetadata()

Return Value

ClassMetadata

ClassMetadataBuilder setMappedSuperClass()

Marks the class as mapped superclass.

Return Value

ClassMetadataBuilder

ClassMetadataBuilder setEmbeddable()

Marks the class as embeddable.

Return Value

ClassMetadataBuilder

$this addEmbedded(string $fieldName, string $class, string|null $columnPrefix = null)

Adds and embedded class

Parameters

string $fieldName
string $class
string|null $columnPrefix

Return Value

$this

ClassMetadataBuilder setCustomRepositoryClass(string $repositoryClassName)

Sets custom Repository class name.

Parameters

string $repositoryClassName

Return Value

ClassMetadataBuilder

ClassMetadataBuilder setReadOnly()

Marks class read only.

Return Value

ClassMetadataBuilder

ClassMetadataBuilder setTable(string $name)

Sets the table name.

Parameters

string $name

Return Value

ClassMetadataBuilder

ClassMetadataBuilder addIndex(array $columns, string $name)

Adds Index.

Parameters

array $columns
string $name

Return Value

ClassMetadataBuilder

ClassMetadataBuilder addUniqueConstraint(array $columns, string $name)

Adds Unique Constraint.

Parameters

array $columns
string $name

Return Value

ClassMetadataBuilder

ClassMetadataBuilder addNamedQuery(string $name, string $dqlQuery)

Adds named query.

Parameters

string $name
string $dqlQuery

Return Value

ClassMetadataBuilder

ClassMetadataBuilder setJoinedTableInheritance()

Sets class as root of a joined table inheritance hierarchy.

Return Value

ClassMetadataBuilder

ClassMetadataBuilder setSingleTableInheritance()

Sets class as root of a single table inheritance hierarchy.

Return Value

ClassMetadataBuilder

ClassMetadataBuilder setDiscriminatorColumn(string $name, string $type = 'string', int $length = 255)

Sets the discriminator column details.

Parameters

string $name
string $type
int $length

Return Value

ClassMetadataBuilder

ClassMetadataBuilder addDiscriminatorMapClass(string $name, string $class)

Adds a subclass to this inheritance hierarchy.

Parameters

string $name
string $class

Return Value

ClassMetadataBuilder

ClassMetadataBuilder setChangeTrackingPolicyDeferredExplicit()

Sets deferred explicit change tracking policy.

Return Value

ClassMetadataBuilder

ClassMetadataBuilder setChangeTrackingPolicyNotify()

Sets notify change tracking policy.

Return Value

ClassMetadataBuilder

ClassMetadataBuilder addLifecycleEvent(string $methodName, string $event)

Adds lifecycle event.

Parameters

string $methodName
string $event

Return Value

ClassMetadataBuilder

ClassMetadataBuilder addField(string $name, string $type, array $mapping = [])

Adds Field.

Parameters

string $name
string $type
array $mapping

Return Value

ClassMetadataBuilder

FieldBuilder createField(string $name, string $type)

Creates a field builder.

Parameters

string $name
string $type

Return Value

FieldBuilder

EmbeddedBuilder createEmbedded(string $fieldName, string $class)

Creates an embedded builder.

Parameters

string $fieldName
string $class

Return Value

EmbeddedBuilder

ClassMetadataBuilder addManyToOne(string $name, string $targetEntity, string|null $inversedBy = null)

Adds a simple many to one association, optionally with the inversed by field.

Parameters

string $name
string $targetEntity
string|null $inversedBy

Return Value

ClassMetadataBuilder

AssociationBuilder createManyToOne(string $name, string $targetEntity)

Creates a ManyToOne Association Builder.

Note: This method does not add the association, you have to call build() on the AssociationBuilder.

Parameters

string $name
string $targetEntity

Return Value

AssociationBuilder

AssociationBuilder createOneToOne(string $name, string $targetEntity)

Creates a OneToOne Association Builder.

Parameters

string $name
string $targetEntity

Return Value

AssociationBuilder

ClassMetadataBuilder addInverseOneToOne(string $name, string $targetEntity, string $mappedBy)

Adds simple inverse one-to-one association.

Parameters

string $name
string $targetEntity
string $mappedBy

Return Value

ClassMetadataBuilder

ClassMetadataBuilder addOwningOneToOne(string $name, string $targetEntity, string|null $inversedBy = null)

Adds simple owning one-to-one association.

Parameters

string $name
string $targetEntity
string|null $inversedBy

Return Value

ClassMetadataBuilder

ManyToManyAssociationBuilder createManyToMany(string $name, string $targetEntity)

Creates a ManyToMany Association Builder.

Parameters

string $name
string $targetEntity

Return Value

ManyToManyAssociationBuilder

ClassMetadataBuilder addOwningManyToMany(string $name, string $targetEntity, string|null $inversedBy = null)

Adds a simple owning many to many association.

Parameters

string $name
string $targetEntity
string|null $inversedBy

Return Value

ClassMetadataBuilder

ClassMetadataBuilder addInverseManyToMany(string $name, string $targetEntity, string $mappedBy)

Adds a simple inverse many to many association.

Parameters

string $name
string $targetEntity
string $mappedBy

Return Value

ClassMetadataBuilder

OneToManyAssociationBuilder createOneToMany(string $name, string $targetEntity)

Creates a one to many association builder.

Parameters

string $name
string $targetEntity

Return Value

OneToManyAssociationBuilder

ClassMetadataBuilder addOneToMany(string $name, string $targetEntity, string $mappedBy)

Adds simple OneToMany association.

Parameters

string $name
string $targetEntity
string $mappedBy

Return Value

ClassMetadataBuilder