18 lines
482 B
PHP
18 lines
482 B
PHP
<?php
|
|
|
|
namespace Lean\Api\Attribute\Action;
|
|
|
|
use Picea\Ui\Method\FormContextInterface;
|
|
use Ulmus\Entity\EntityInterface;
|
|
|
|
#[\Attribute(\Attribute::TARGET_PROPERTY)]
|
|
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;
|
|
}
|
|
} |