Skip to main content

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:

ParameterTypeDescription
$displayNamestring
$schemaTypestring
$versionstring
$descriptionstring
$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:

ParameterTypeDescription
$namestring
$technicalNamestring
$descriptionstring|null
$requiredbool

addIntegerAttribute

Adds an integer attribute descriptor to the schema builder.

public addIntegerAttribute(string $name, string $technicalName, string|null $description, bool $required): $this

Parameters:

ParameterTypeDescription
$namestring
$technicalNamestring
$descriptionstring|null
$requiredbool

addDecimalAttribute

Adds a decimal attribute descriptor to the schema builder.

public addDecimalAttribute(string $name, string $technicalName, string|null $description, bool $required): $this

Parameters:

ParameterTypeDescription
$namestring
$technicalNamestring
$descriptionstring|null
$requiredbool

addBooleanAttribute

Adds a boolean attribute descriptor to the schema builder.

public addBooleanAttribute(string $name, string $technicalName, string|null $description, bool $required): $this

Parameters:

ParameterTypeDescription
$namestring
$technicalNamestring
$descriptionstring|null
$requiredbool

addDateAttribute

Adds a date attribute descriptor to the schema builder.

public addDateAttribute(string $name, string $technicalName, string|null $description, bool $required): $this

Parameters:

ParameterTypeDescription
$namestring
$technicalNamestring
$descriptionstring|null
$requiredbool

addDateTimeAttribute

Adds a datetime attribute descriptor to the schema builder.

public addDateTimeAttribute(string $name, string $technicalName, string|null $description, bool $required): $this

Parameters:

ParameterTypeDescription
$namestring
$technicalNamestring
$descriptionstring|null
$requiredbool

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:

ParameterTypeDescription
$namestring
$technicalNamestring
$descriptionstring|null
$requiredbool
$enumerationarray

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:

ParameterTypeDescription
$namestring
$technicalNamestring
$descriptionstring|null
$requiredbool
$enumerationarray

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:

ParameterTypeDescription
$namestring
$technicalNamestring
$descriptionstring|null
$requiredbool
$enumerationarray

build

Creates a schema using the configured attributes.

public build(): \Bloock\Entity\Identity\Schema

Throws:



Automatically generated on 2024-04-02