FieldBuilder
in package
Field Builder
Tags
Table of Contents
- $builder : ClassMetadataBuilder
- $customIdGenerator : string|null
- $generatedValue : string
- $mapping : array<string|int, mixed>
- $sequenceDef : array<string|int, mixed>
- $version : bool
- __construct() : mixed
- build() : ClassMetadataBuilder
- Finalizes this field and attach it to the ClassMetadata.
- columnDefinition() : $this
- Sets column definition.
- columnName() : $this
- Sets column name.
- generatedValue() : $this
- isPrimaryKey() : FieldBuilder
- Sets field as primary key.
- isVersionField() : $this
- Sets field versioned.
- length() : $this
- Sets length.
- makePrimaryKey() : $this
- Sets field as primary key.
- nullable() : $this
- Sets nullable.
- option() : $this
- Sets an option.
- precision() : $this
- Sets Precision.
- scale() : $this
- Sets scale.
- setCustomIdGenerator() : $this
- Set the FQCN of the custom ID generator.
- setSequenceGenerator() : $this
- Sets Sequence Generator.
- unique() : $this
- Sets Unique.
Properties
$builder
private
ClassMetadataBuilder
$builder
$customIdGenerator
private
string|null
$customIdGenerator
$generatedValue
private
string
$generatedValue
$mapping
private
array<string|int, mixed>
$mapping
$sequenceDef
private
array<string|int, mixed>
$sequenceDef
$version
private
bool
$version
Methods
__construct()
public
__construct(ClassMetadataBuilder $builder, array<string|int, mixed> $mapping) : mixed
Parameters
- $builder : ClassMetadataBuilder
- $mapping : array<string|int, mixed>
Return values
mixed —build()
Finalizes this field and attach it to the ClassMetadata.
public
build() : ClassMetadataBuilder
Without this call a FieldBuilder has no effect on the ClassMetadata.
Return values
ClassMetadataBuilder —columnDefinition()
Sets column definition.
public
columnDefinition(string $def) : $this
Parameters
- $def : string
Return values
$this —columnName()
Sets column name.
public
columnName(string $name) : $this
Parameters
- $name : string
Return values
$this —generatedValue()
public
generatedValue([string $strategy = 'AUTO' ]) : $this
Parameters
- $strategy : string = 'AUTO'
Return values
$this —isPrimaryKey()
Sets field as primary key.
public
isPrimaryKey() : FieldBuilder
Tags
Return values
FieldBuilder —isVersionField()
Sets field versioned.
public
isVersionField() : $this
Return values
$this —length()
Sets length.
public
length(int $length) : $this
Parameters
- $length : int
Return values
$this —makePrimaryKey()
Sets field as primary key.
public
makePrimaryKey() : $this
Return values
$this —nullable()
Sets nullable.
public
nullable([bool $flag = true ]) : $this
Parameters
- $flag : bool = true
Return values
$this —option()
Sets an option.
public
option(string $name, mixed $value) : $this
Parameters
- $name : string
- $value : mixed
Return values
$this —precision()
Sets Precision.
public
precision(int $p) : $this
Parameters
- $p : int
Return values
$this —scale()
Sets scale.
public
scale(int $s) : $this
Parameters
- $s : int
Return values
$this —setCustomIdGenerator()
Set the FQCN of the custom ID generator.
public
setCustomIdGenerator(string $customIdGenerator) : $this
This class must extend \Doctrine\ORM\Id\AbstractIdGenerator.
Parameters
- $customIdGenerator : string
Return values
$this —setSequenceGenerator()
Sets Sequence Generator.
public
setSequenceGenerator(string $sequenceName[, int $allocationSize = 1 ][, int $initialValue = 1 ]) : $this
Parameters
- $sequenceName : string
- $allocationSize : int = 1
- $initialValue : int = 1
Return values
$this —unique()
Sets Unique.
public
unique([bool $flag = true ]) : $this
Parameters
- $flag : bool = true