diff --git a/src/Attribute/Action/ValueAppend.php b/src/Attribute/Action/ValueAppend.php index daf6db6..9c8ece0 100644 --- a/src/Attribute/Action/ValueAppend.php +++ b/src/Attribute/Action/ValueAppend.php @@ -10,7 +10,6 @@ class ValueAppend extends \Lean\Api\Attribute\Action { public function action(EntityInterface $entity, string $key, FormContextInterface $context, string $field): ActionTypeEnum { - dump($entity->$key); array_push($entity->$key, $context->$field); return ActionTypeEnum::Setter; diff --git a/src/Form/Save.php b/src/Form/Save.php index 9a5b6eb..21a05f5 100644 --- a/src/Form/Save.php +++ b/src/Form/Save.php @@ -149,7 +149,6 @@ abstract class Save extends Form implements \Picea\Ui\Method\FormInterface { if (! in_array(ActionTypeEnum::Setter, $actions)) { new ValueSet()->action($entity, $key, $context, $var); } - } } elseif (! $entity->isLoaded() && $contextField) { diff --git a/src/Lib/FormContext.php b/src/Lib/FormContext.php index 0daee28..8e9877a 100644 --- a/src/Lib/FormContext.php +++ b/src/Lib/FormContext.php @@ -5,7 +5,6 @@ namespace Lean\Api\Lib; use Lean\Api\Factory\MessageFactoryInterface; use Lean\LanguageHandler; use Psr\Http\Message\ServerRequestInterface; -use Ulmus\Entity\EntityInterface; class FormContext extends \Picea\Ui\Method\FormContext { diff --git a/view/lean-api/entity_descriptor.phtml b/view/lean-api/entity_descriptor.phtml index 8626d9c..fb9a37e 100644 --- a/view/lean-api/entity_descriptor.phtml +++ b/view/lean-api/entity_descriptor.phtml @@ -32,11 +32,11 @@ %} {% endfunction %} -{% function yesOrNo(bool $toggle) : void %} +{% function.overwrite yesOrNo(bool $toggle) : void %} {{ $toggle ? 'oui' : 'non' }} {% endfunction %} -{% function length(int|null|string $length): void %} +{% function.overwrite length(int|null|string $length): void %} {{ $length ?? "non-défini" }} {% endfunction %} diff --git a/view/lean-api/form_descriptor.phtml b/view/lean-api/form_descriptor.phtml index a8f5442..eb16fb6 100644 --- a/view/lean-api/form_descriptor.phtml +++ b/view/lean-api/form_descriptor.phtml @@ -1,6 +1,6 @@ {% language.set "lean.api.descriptor.form" %} -{% function yesOrNo(bool $toggle) : void %} +{% function.inline yesOrNo(bool $toggle) : void %} {{ $toggle ? 'oui' : 'non' }} {% endfunction %} @@ -30,7 +30,7 @@
Variable POST / champ JSON : {{ $field['name'] }}
Type(s) : {{ implode(' | ', array_map(fn($e) => $e->type, $field['type'])) }}
-
Nullable : {{ yesOrNo($field['allowNulls']) }}
+
Nullable : {{ $yesOrNo($field['allowNulls']) }}
{% if $field['regexPattern'] !== null %}
Pattern regex : {{ $field['regexPattern'] }}
{% endif %}