Model/src/ArrayBlueprint.php

46 lines
890 B
PHP

<?php
namespace Nest\Model;
abstract class ArrayBlueprint
{
protected string $type;
protected ?string $table = null;
protected ?string $foreignKeyName = null;
protected ?string $foreignValueName = null;
/**
* @param class-string $entityClass Entity class where the field is defined.
* @param string $name Name of the field.
*/
public function __construct(protected string $entityClass, protected string $name)
{
}
public function type(string $type): static
{
$this->type = $type;
return $this;
}
public function table(string $table): static
{
$this->table = $table;
return $this;
}
public function foreignKeyName(string $foreignKeyName): static
{
$this->foreignValueName = $foreignKeyName;
return $this;
}
public function foreignValueName(string $foreignValueName): static
{
$this->foreignValueName = $foreignValueName;
return $this;
}
}