46 lines
1.4 KiB
PHP
46 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace %NAMESPACE%\Factory;
|
|
|
|
use Lean\Api\Factory\MessageFactoryInterface;
|
|
use Lean\LanguageHandler;
|
|
use Picea\Ui\Method\FormContextInterface;
|
|
use Picea\Ui\Method\FormInterface;
|
|
use Psr\Http\Message\ServerRequestInterface;
|
|
use Storage\Session;
|
|
use Ulmus\Entity\EntityInterface;
|
|
use Ulmus\User\Entity\UserInterface;
|
|
use Ulmus\User\Lib\Authenticate;
|
|
|
|
class FormFactory implements FormFactoryInterface
|
|
{
|
|
/*
|
|
public function __construct(
|
|
protected ServerRequestInterface $request,
|
|
protected Authenticate $authenticate,
|
|
protected Session $session,
|
|
protected LanguageHandler $languageHandler,
|
|
protected MessageFactoryInterface $messageFactory,
|
|
) {}
|
|
|
|
public function save(EntityInterface $entity): FormInterface
|
|
{
|
|
return new Form\Save($this->languageHandler, $this->messageFactory, $entity);
|
|
}
|
|
|
|
public function saveContext(? ServerRequestInterface $request = null, ? string $formName = null): FormContextInterface
|
|
{
|
|
return new Form\SaveContext($request ?: $this->request, $formName);
|
|
}
|
|
|
|
public function delete(EntityInterface $entity): FormInterface
|
|
{
|
|
return new Form\Delete($this->languageHandler, $this->messageFactory, $entity);
|
|
}
|
|
|
|
public function deleteContext(?ServerRequestInterface $request = null, ?string $formName = null): FormContextInterface
|
|
{
|
|
return new Lib\FormContext($request, $formName);
|
|
}
|
|
*/
|
|
} |