39 lines
888 B
PHP
39 lines
888 B
PHP
<?php
|
|
|
|
namespace Lucent\Schema\BlockUi;
|
|
|
|
use Lucent\Record\RecordData;
|
|
use Lucent\Schema\Field\FieldDataInterface;
|
|
use Lucent\Schema\Field\FieldInfo;
|
|
use Lucent\Schema\Field\FieldInterface;
|
|
use Lucent\Schema\Field\FieldType;
|
|
|
|
class Heading implements FieldInterface,FieldDataInterface
|
|
{
|
|
public FieldInfo $info;
|
|
|
|
public function __construct(
|
|
public string $name,
|
|
public string $label,
|
|
public ?int $min = null,
|
|
public ?int $max = null,
|
|
public string $default = "",
|
|
)
|
|
{
|
|
$this->info = new FieldInfo("heading", "Heading", FieldType::STRING);
|
|
}
|
|
|
|
public function format(RecordData $input, RecordData $output): RecordData
|
|
{
|
|
$value = $input->get($this->name);
|
|
$output->set($this->name,$value);
|
|
return $output;
|
|
}
|
|
|
|
public function isRequired(): bool
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|