Files
lucent-laravel/src/Schema/BlockUi/Heading.php
T

39 lines
888 B
PHP
Raw Normal View History

2023-10-14 18:06:36 +03:00
<?php
namespace Lucent\Schema\BlockUi;
2024-03-21 22:33:41 +02:00
use Lucent\Record\RecordData;
use Lucent\Schema\Field\FieldDataInterface;
use Lucent\Schema\Field\FieldInfo;
use Lucent\Schema\Field\FieldInterface;
use Lucent\Schema\Field\FieldType;
2023-10-14 18:06:36 +03:00
2024-03-21 22:33:41 +02:00
class Heading implements FieldInterface,FieldDataInterface
2023-10-14 18:06:36 +03:00
{
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);
}
2024-03-21 22:33:41 +02:00
public function format(RecordData $input, RecordData $output): RecordData
2023-10-14 18:06:36 +03:00
{
2024-03-21 22:33:41 +02:00
$value = $input->get($this->name);
$output->set($this->name,$value);
2023-10-14 18:06:36 +03:00
return $output;
}
2024-03-19 23:05:57 +02:00
public function isRequired(): bool
{
return false;
}
2023-10-14 18:06:36 +03:00
}