- Various fixes bugs and missing code in project's skeleton
This commit is contained in:
1 parent
7a48d707e0
commit
dc52c88c03
9 files changed
+124
-10
No files matched your search
@@ -7,6 +7,10 @@ use function DI\{ autowire, add, create, get };
|
||||
$dir = dirname(__DIR__, 2);
|
||||
|
||||
return [
|
||||
\%NAMESPACE%\Factory\FormFactoryInterface::class => autowire(Factory\FormFactory::class),
|
||||
\Lean\Api\Factory\MessageFactoryInterface::class => autowire(\%NAMESPACE%\Lib\Message::class),
|
||||
|
||||
|
||||
'%APPKEY%' => [
|
||||
'picea' => [
|
||||
'context' => "%ESCAPED_NAMESPACE%\\View",
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<?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);
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace %NAMESPACE%\Factory;
|
||||
|
||||
use Lean\Api\Factory\MessageFactoryInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Picea\Ui\Method\{ FormInterface, FormContextInterface };
|
||||
use Storage\Session;
|
||||
use Lean\LanguageHandler;
|
||||
use Ulmus\Entity\EntityInterface;
|
||||
use Ulmus\User\Entity\UserInterface;
|
||||
use Ulmus\User\Lib\Authenticate;
|
||||
|
||||
interface FormFactoryInterface
|
||||
{
|
||||
/* public function __construct(ServerRequestInterface $request, Authenticate $authenticate, Session $session, LanguageHandler $languageHandler, MessageFactoryInterface $messageFactory,);
|
||||
|
||||
public function save(EntityInterface $entity): FormInterface;
|
||||
|
||||
public function saveContext(?ServerRequestInterface $request = null, ?string $formName = null): FormContextInterface;
|
||||
|
||||
public function delete(EntityInterface $entity): FormInterface;
|
||||
|
||||
public function deleteContext(?ServerRequestInterface $request = null, ?string $formName = null): FormContextInterface;*/
|
||||
}
|
||||
Reference in new issue
Block a user