@@ -332,6 +332,18 @@ abstract class AbstractAdminController extends EaAbstractCrudController | |||
); | |||
} | |||
public function createEntity(string $entityFqcn) | |||
{ | |||
if(method_exists($this, 'getEntityFactory')) { | |||
$factoryClass = $this->getEntityFactory(); | |||
$factory = new $factoryClass; | |||
return $factory->create(); | |||
} | |||
else { | |||
return parent::createEntity($entityFqcn); | |||
} | |||
} | |||
public function updateEntity(EntityManagerInterface $entityManager, $entityInstance): void | |||
{ | |||
$entityManager->update($entityInstance); |
@@ -35,7 +35,7 @@ class SettingAdminController extends AbstractController | |||
} | |||
/** | |||
* @Route("/admin/setting/site", name="sov_admin_setting_global") | |||
* @Route("/admin/setting/site", name="sov_admin_setting_site") | |||
*/ | |||
public function manageGlobal(Request $request) | |||
{ |
@@ -14,7 +14,7 @@ use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGenerator; | |||
use Lc\SovBundle\Factory\Ticket\TicketFactoryInterface; | |||
use Lc\SovBundle\Factory\Ticket\TicketMessageFactory; | |||
use Lc\SovBundle\Factory\Ticket\TicketMessageFactoryInterface; | |||
use Lc\SovBundle\Form\Ticket\TicketFormType; | |||
use Lc\SovBundle\Form\Ticket\TicketMessageFormType; | |||
use Lc\SovBundle\Form\Ticket\TicketStatusType; | |||
@@ -33,7 +33,7 @@ class TicketAdminController extends AbstractAdminController | |||
public function __construct( | |||
TicketFactoryInterface $ticketFactory, | |||
TicketMessageFactory $ticketMessageFactory, | |||
TicketMessageFactoryInterface $ticketMessageFactory, | |||
AdminUrlGenerator $adminUrlGenerator | |||
) { | |||
$this->ticketFactory = $ticketFactory; |
@@ -0,0 +1,16 @@ | |||
<?php | |||
namespace Lc\SovBundle\Factory\Site; | |||
use App\Entity\Site\Page; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class PageFactory extends AbstractFactory | |||
{ | |||
public function create() | |||
{ | |||
$page = new Page(); | |||
return $page; | |||
} | |||
} |
@@ -7,9 +7,9 @@ use Lc\SovBundle\Factory\AbstractFactory; | |||
class TicketFactory extends AbstractFactory implements TicketFactoryInterface | |||
{ | |||
protected TicketMessageFactory $ticketMessageFactory; | |||
protected TicketMessageFactoryInterface $ticketMessageFactory; | |||
public function __construct(TicketMessageFactory $ticketMessageFactory) | |||
public function __construct(TicketMessageFactoryInterface $ticketMessageFactory) | |||
{ | |||
$this->ticketMessageFactory = $ticketMessageFactory; | |||
} |
@@ -5,7 +5,7 @@ namespace Lc\SovBundle\Factory\Ticket; | |||
use App\Entity\Ticket\TicketMessage; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class TicketMessageFactory extends AbstractFactory | |||
class TicketMessageFactory extends AbstractFactory implements TicketMessageFactoryInterface | |||
{ | |||
public function create() | |||
{ |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\SovBundle\Factory\Ticket; | |||
interface TicketMessageFactoryInterface | |||
{ | |||
} |
@@ -5,7 +5,7 @@ namespace Lc\SovBundle\Repository\Reminder; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class ReminderRepositoryQuery extends AbstractRepositoryQuery | |||
class ReminderRepositoryQuery extends AbstractRepositoryQuery implements ReminderRepositoryQueryInterface | |||
{ | |||
public function __construct(ReminderRepositoryInterface $repository, PaginatorInterface $paginator) | |||
{ |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Reminder; | |||
interface ReminderRepositoryQueryInterface | |||
{ | |||
} |
@@ -2,11 +2,11 @@ | |||
namespace Lc\SovBundle\Repository\Reminder; | |||
class ReminderStore | |||
class ReminderStore implements ReminderStoreInterface | |||
{ | |||
protected ReminderRepositoryQuery $query; | |||
protected ReminderRepositoryQueryInterface $query; | |||
public function __construct(ReminderRepositoryQuery $query) | |||
public function __construct(ReminderRepositoryQueryInterface $query) | |||
{ | |||
$this->query = $query; | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Reminder; | |||
interface ReminderStoreInterface | |||
{ | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Ticket; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class TicketRepositoryQuery extends AbstractRepositoryQuery implements TicketRepositoryQueryInterface | |||
{ | |||
public function __construct(TicketRepositoryInterface $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Ticket; | |||
interface TicketRepositoryQueryInterface | |||
{ | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Ticket; | |||
class TicketStore implements TicketStoreInterface | |||
{ | |||
protected TicketRepositoryQueryInterface $query; | |||
public function __construct(TicketRepositoryQueryInterface $query) | |||
{ | |||
$this->query = $query; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Ticket; | |||
interface TicketStoreInterface | |||
{ | |||
} |
@@ -2,18 +2,11 @@ | |||
namespace Lc\SovBundle\Twig; | |||
use App\Repository\ReminderRepository; | |||
use Doctrine\ORM\EntityManagerInterface; | |||
use Lc\SovBundle\Model\Reminder\ReminderInterface; | |||
use Lc\SovBundle\Repository\Reminder\ReminderStore; | |||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||
use Liip\ImagineBundle\Imagine\Cache\CacheManager; | |||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; | |||
use Symfony\Component\HttpFoundation\RequestStack; | |||
use Symfony\Component\HttpKernel\KernelInterface; | |||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface; | |||
use Symfony\Component\Security\Core\Security; | |||
use Symfony\Contracts\Translation\TranslatorInterface; | |||
use Twig\Extension\AbstractExtension; | |||
use Twig\TwigFilter; | |||
use Twig\TwigFunction; |
@@ -4,7 +4,6 @@ namespace Lc\SovBundle\Twig; | |||
use App\Repository\ReminderRepository; | |||
use Doctrine\ORM\EntityManagerInterface; | |||
use Lc\SovBundle\Model\Reminder\ReminderInterface; | |||
use Lc\SovBundle\Repository\Reminder\ReminderStore; | |||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||
use Liip\ImagineBundle\Imagine\Cache\CacheManager; |