class FieldBuilder (View source)

Field Builder

Methods

__construct(ClassMetadataBuilder $builder, array $mapping)

No description

length(int $length)

Sets length.

nullable(bool $flag = true)

Sets nullable.

unique(bool $flag = true)

Sets Unique.

columnName(string $name)

Sets column name.

precision(int $p)

Sets Precision.

scale(int $s)

Sets scale.

isPrimaryKey() deprecated

Sets field as primary key.

makePrimaryKey()

Sets field as primary key.

option(string $name, mixed $value)

Sets an option.

generatedValue(string $strategy = 'AUTO')

No description

isVersionField()

Sets field versioned.

setSequenceGenerator(string $sequenceName, int $allocationSize = 1, int $initialValue = 1)

Sets Sequence Generator.

columnDefinition(string $def)

Sets column definition.

$this
setCustomIdGenerator(string $customIdGenerator)

Set the FQCN of the custom ID generator.

build()

Finalizes this field and attach it to the ClassMetadata.

Details

__construct(ClassMetadataBuilder $builder, array $mapping)

Parameters

ClassMetadataBuilder $builder
array $mapping

FieldBuilder length(int $length)

Sets length.

Parameters

int $length

Return Value

FieldBuilder

FieldBuilder nullable(bool $flag = true)

Sets nullable.

Parameters

bool $flag

Return Value

FieldBuilder

FieldBuilder unique(bool $flag = true)

Sets Unique.

Parameters

bool $flag

Return Value

FieldBuilder

FieldBuilder columnName(string $name)

Sets column name.

Parameters

string $name

Return Value

FieldBuilder

FieldBuilder precision(int $p)

Sets Precision.

Parameters

int $p

Return Value

FieldBuilder

FieldBuilder scale(int $s)

Sets scale.

Parameters

int $s

Return Value

FieldBuilder

FieldBuilder isPrimaryKey() deprecated

deprecated Use makePrimaryKey() instead

Sets field as primary key.

Return Value

FieldBuilder

FieldBuilder makePrimaryKey()

Sets field as primary key.

Return Value

FieldBuilder

FieldBuilder option(string $name, mixed $value)

Sets an option.

Parameters

string $name
mixed $value

Return Value

FieldBuilder

FieldBuilder generatedValue(string $strategy = 'AUTO')

Parameters

string $strategy

Return Value

FieldBuilder

FieldBuilder isVersionField()

Sets field versioned.

Return Value

FieldBuilder

FieldBuilder setSequenceGenerator(string $sequenceName, int $allocationSize = 1, int $initialValue = 1)

Sets Sequence Generator.

Parameters

string $sequenceName
int $allocationSize
int $initialValue

Return Value

FieldBuilder

FieldBuilder columnDefinition(string $def)

Sets column definition.

Parameters

string $def

Return Value

FieldBuilder

$this setCustomIdGenerator(string $customIdGenerator)

Set the FQCN of the custom ID generator.

This class must extend \Doctrine\ORM\Id\AbstractIdGenerator.

Parameters

string $customIdGenerator

Return Value

$this

ClassMetadataBuilder build()

Finalizes this field and attach it to the ClassMetadata.

Without this call a FieldBuilder has no effect on the ClassMetadata.

Return Value

ClassMetadataBuilder