- WIP on visual of API
This commit is contained in:
1 parent
3d81b71473
commit
21f315cc22
10 files changed
+230
-32
No files matched your search
+3
-16
@@ -2,24 +2,16 @@
|
||||
|
||||
namespace Lean\Api\Form;
|
||||
|
||||
use CSSLSJ\ExamenFga\Api\{Form\Location\SessionContext, Lib, Entity};
|
||||
use Picea\Ui\Method\{ FormContextInterface, Message\ErrorMessage };
|
||||
use Picea\Ui\Method\{ FormContextInterface, };
|
||||
|
||||
use Ulmus\Attribute\Property\Field;
|
||||
use Lean\Api\Attribute\EntityField;
|
||||
use Lean\LanguageHandler;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
use Ulmus\Entity\EntityInterface;
|
||||
use Ulmus\Entity\Field\Datetime;
|
||||
use function CSSLSJ\ExamenFga\Api\View\{ lang };
|
||||
|
||||
abstract class Save implements \Picea\Ui\Method\FormInterface {
|
||||
|
||||
public function __construct(
|
||||
protected LanguageHandler $languageHandler,
|
||||
# public EntityInterface $entity,
|
||||
) {}
|
||||
use FormTrait;
|
||||
|
||||
public function getEntity() : EntityInterface
|
||||
{
|
||||
@@ -51,7 +43,7 @@ abstract class Save implements \Picea\Ui\Method\FormInterface {
|
||||
$this->assignContextToEntity($context);
|
||||
|
||||
if ( $entity::repository()->save($entity) ) {
|
||||
$context->pushMessage(Lib\Message::generateSuccess(
|
||||
$context->pushMessage($this->message::generateSuccess(
|
||||
$this->lang('lean.api.form.save.success.entity')
|
||||
));
|
||||
}
|
||||
@@ -64,11 +56,6 @@ abstract class Save implements \Picea\Ui\Method\FormInterface {
|
||||
}
|
||||
}
|
||||
|
||||
protected function lang(string $key, array $variables = [])
|
||||
{
|
||||
return $this->languageHandler->languageFromKey($key, $variables);
|
||||
}
|
||||
|
||||
protected function assignContextToEntity(FormContextInterface $context) : void
|
||||
{
|
||||
$entity = $this->getEntity();
|
||||
|
||||
Reference in new issue
Block a user