- Added a new ActionLog middleware to catch every modifying request and save the changes made and the user who did. - Added a new RequestLog to catch every request made whenever required.
32 lines
1.1 KiB
PHP
32 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Lean\Api\Factory\FormFactories;
|
|
|
|
use Picea\Ui\Method\FormContextInterface;
|
|
use Picea\Ui\Method\FormInterface;
|
|
use Psr\Http\Message\ServerRequestInterface;
|
|
use Ulmus\Entity\EntityInterface;
|
|
use Lean\Api\{Factory, Form, Entity, Lib};
|
|
|
|
trait DebugTrait{
|
|
|
|
public function errorSave(EntityInterface|Entity\Error $entity): FormInterface
|
|
{
|
|
return new Form\Debug\ErrorSave($this->languageHandler, $this->messageFactory, $entity);
|
|
}
|
|
|
|
public function errorSaveContext(? ServerRequestInterface $request = null, ? string $formName = null): FormContextInterface
|
|
{
|
|
return new Form\Debug\ErrorContext($request ?: $this->request, $formName);
|
|
}
|
|
|
|
public function errorDelete(EntityInterface|Entity\Error $entity): FormInterface
|
|
{
|
|
return new Form\Debug\ErrorDelete($this->languageHandler, $this->messageFactory, $entity);
|
|
}
|
|
|
|
public function errorDeleteContext(?ServerRequestInterface $request = null, ?string $formName = null): FormContextInterface
|
|
{
|
|
return new Lib\FormContext($request, $formName);
|
|
}
|
|
} |