SchemaBuilder
Is a builder pattern for constructing schema instances.
- Full name: \Bloock\Entity\Identity\SchemaBuilder
Properties
displayName
private string $displayName
schemaType
private string $schemaType
version
private string $version
description
private string $description
configData
private \Bloock\ConfigData $configData
stringAttributes
private array $stringAttributes
integerAttributes
private array $integerAttributes
decimalAttributes
private array $decimalAttributes
booleanAttributes
private array $booleanAttributes
dateAttributes
private array $dateAttributes
datetimeAttributes
private array $datetimeAttributes
stringEnumAttributes
private array $stringEnumAttributes
integerEnumAttributes
private array $integerEnumAttributes
decimalEnumAttributes
private array $decimalEnumAttributes
Methods
__construct
Creates a new instance of SchemaBuilder with initial values.
public __construct(string $displayName, string $schemaType, string $version, string $description, \Bloock\ConfigData $configData): mixed
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| $displayName | string | |
| $schemaType | string | |
| $version | string | |
| $description | string | |
| $configData | \Bloock\ConfigData | 
addStringAttribute
Adds a string attribute descriptor to the schema builder.
public addStringAttribute(string $name, string $technicalName, string|null $description, bool $required): $this
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| $name | string | |
| $technicalName | string | |
| $description | string|null | |
| $required | bool | 
addIntegerAttribute
Adds an integer attribute descriptor to the schema builder.
public addIntegerAttribute(string $name, string $technicalName, string|null $description, bool $required): $this
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| $name | string | |
| $technicalName | string | |
| $description | string|null | |
| $required | bool | 
addDecimalAttribute
Adds a decimal attribute descriptor to the schema builder.
public addDecimalAttribute(string $name, string $technicalName, string|null $description, bool $required): $this
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| $name | string | |
| $technicalName | string | |
| $description | string|null | |
| $required | bool | 
addBooleanAttribute
Adds a boolean attribute descriptor to the schema builder.
public addBooleanAttribute(string $name, string $technicalName, string|null $description, bool $required): $this
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| $name | string | |
| $technicalName | string | |
| $description | string|null | |
| $required | bool | 
addDateAttribute
Adds a date attribute descriptor to the schema builder.
public addDateAttribute(string $name, string $technicalName, string|null $description, bool $required): $this
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| $name | string | |
| $technicalName | string | |
| $description | string|null | |
| $required | bool | 
addDateTimeAttribute
Adds a datetime attribute descriptor to the schema builder.
public addDateTimeAttribute(string $name, string $technicalName, string|null $description, bool $required): $this
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| $name | string | |
| $technicalName | string | |
| $description | string|null | |
| $required | bool | 
addStringEnumAttribute
Adds a string enum attribute descriptor to the schema builder.
public addStringEnumAttribute(string $name, string $technicalName, string|null $description, bool $required, array $enumeration): $this
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| $name | string | |
| $technicalName | string | |
| $description | string|null | |
| $required | bool | |
| $enumeration | array | 
addIntegerEnumAttribute
Adds an integer enum attribute descriptor to the schema builder.
public addIntegerEnumAttribute(string $name, string $technicalName, string|null $description, bool $required, array $enumeration): $this
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| $name | string | |
| $technicalName | string | |
| $description | string|null | |
| $required | bool | |
| $enumeration | array | 
addDecimalEnumAttribute
Adds a decimal enum attribute descriptor to the schema builder.
public addDecimalEnumAttribute(string $name, string $technicalName, string|null $description, bool $required, array $enumeration): $this
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| $name | string | |
| $technicalName | string | |
| $description | string|null | |
| $required | bool | |
| $enumeration | array | 
build
Creates a schema using the configured attributes.
public build(): \Bloock\Entity\Identity\Schema
Throws:
Automatically generated on 2024-04-17