refactor fields

This commit is contained in:
2024-03-21 22:33:41 +02:00
parent bb77a37ff7
commit 8526fd471f
68 changed files with 635 additions and 297 deletions
+9 -8
View File
@@ -2,13 +2,13 @@
namespace Lucent\Schema\BlockUi;
use Lucent\Schema\FieldInfo;
use Lucent\Schema\FieldInterface;
use Lucent\Schema\FieldType;
use Lucent\Schema\Nullable;
use Lucent\Schema\Validator\RequiredInterface;
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 Markdown implements FieldInterface
class Markdown implements FieldInterface,FieldDataInterface
{
public FieldInfo $info;
@@ -23,9 +23,10 @@ class Markdown implements FieldInterface
$this->info = new FieldInfo("markdown", "Markdown Editor", FieldType::STRING);
}
public function format(array $input, array $output): array
public function format(RecordData $input, RecordData $output): RecordData
{
$output[$this->name] = $input[$this->name] ?? "";
$value = $input->get($this->name);
$output->set($this->name,$value);
return $output;
}
public function isRequired(): bool