Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23b84f149f |
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
@@ -32,11 +32,11 @@
|
||||
%}
|
||||
{% endfunction %}
|
||||
|
||||
{% function yesOrNo(bool $toggle) : void %}
|
||||
{% function.overwrite yesOrNo(bool $toggle) : void %}
|
||||
<span style="color: {{ $toggle ? 'green' : '#ac1b1b' }}">{{ $toggle ? 'oui' : 'non' }}</span>
|
||||
{% endfunction %}
|
||||
|
||||
{% function length(int|null|string $length): void %}
|
||||
{% function.overwrite length(int|null|string $length): void %}
|
||||
<span style="color:{{ $length ? 'black' : 'gray' }}">{{ $length ?? "non-défini" }}</span>
|
||||
{% endfunction %}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% language.set "lean.api.descriptor.form" %}
|
||||
|
||||
{% function yesOrNo(bool $toggle) : void %}
|
||||
{% function.inline yesOrNo(bool $toggle) : void %}
|
||||
<span style="color: {{ $toggle ? 'green' : '#ac1b1b' }}">{{ $toggle ? 'oui' : 'non' }}</span>
|
||||
{% endfunction %}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<div class="field-desc" style="margin-top:10px;;background:#fff;padding:5px;font-size:0.9em">
|
||||
<div><u>Variable POST / champ JSON</u> : {{ $field['name'] }}</div>
|
||||
<div><u>Type(s)</u> : {{ implode(' | ', array_map(fn($e) => $e->type, $field['type'])) }}</div>
|
||||
<div><u>Nullable</u> : {{ yesOrNo($field['allowNulls']) }}</div>
|
||||
<div><u>Nullable</u> : {{ $yesOrNo($field['allowNulls']) }}</div>
|
||||
{% if $field['regexPattern'] !== null %}
|
||||
<div><u>Pattern regex</u> : {{ $field['regexPattern'] }}</div>
|
||||
{% endif %}
|
||||
|
||||
Reference in new issue
Block a user