refactor fields
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user