Files
lean-api/src/Factory/FormFactories/DebugTrait.php
T
Dave Mc Nicoll 4b86ac9e82 - Added a new CSRF token verification Middleware.
- 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.
2026-10-22 15:03:18 +00:00

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);
}
}