); | ); | ||||
} | } | ||||
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 | public function updateEntity(EntityManagerInterface $entityManager, $entityInstance): void | ||||
{ | { | ||||
$entityManager->update($entityInstance); | $entityManager->update($entityInstance); |
} | } | ||||
/** | /** | ||||
* @Route("/admin/setting/site", name="sov_admin_setting_global") | |||||
* @Route("/admin/setting/site", name="sov_admin_setting_site") | |||||
*/ | */ | ||||
public function manageGlobal(Request $request) | public function manageGlobal(Request $request) | ||||
{ | { |
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGenerator; | use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGenerator; | ||||
use Lc\SovBundle\Factory\Ticket\TicketFactoryInterface; | 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\TicketFormType; | ||||
use Lc\SovBundle\Form\Ticket\TicketMessageFormType; | use Lc\SovBundle\Form\Ticket\TicketMessageFormType; | ||||
use Lc\SovBundle\Form\Ticket\TicketStatusType; | use Lc\SovBundle\Form\Ticket\TicketStatusType; | ||||
public function __construct( | public function __construct( | ||||
TicketFactoryInterface $ticketFactory, | TicketFactoryInterface $ticketFactory, | ||||
TicketMessageFactory $ticketMessageFactory, | |||||
TicketMessageFactoryInterface $ticketMessageFactory, | |||||
AdminUrlGenerator $adminUrlGenerator | AdminUrlGenerator $adminUrlGenerator | ||||
) { | ) { | ||||
$this->ticketFactory = $ticketFactory; | $this->ticketFactory = $ticketFactory; |
<?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; | |||||
} | |||||
} |
class TicketFactory extends AbstractFactory implements TicketFactoryInterface | 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; | $this->ticketMessageFactory = $ticketMessageFactory; | ||||
} | } |
use App\Entity\Ticket\TicketMessage; | use App\Entity\Ticket\TicketMessage; | ||||
use Lc\SovBundle\Factory\AbstractFactory; | use Lc\SovBundle\Factory\AbstractFactory; | ||||
class TicketMessageFactory extends AbstractFactory | |||||
class TicketMessageFactory extends AbstractFactory implements TicketMessageFactoryInterface | |||||
{ | { | ||||
public function create() | public function create() | ||||
{ | { |
<?php | |||||
namespace Lc\SovBundle\Factory\Ticket; | |||||
interface TicketMessageFactoryInterface | |||||
{ | |||||
} |
use Knp\Component\Pager\PaginatorInterface; | use Knp\Component\Pager\PaginatorInterface; | ||||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | use Lc\SovBundle\Repository\AbstractRepositoryQuery; | ||||
class ReminderRepositoryQuery extends AbstractRepositoryQuery | |||||
class ReminderRepositoryQuery extends AbstractRepositoryQuery implements ReminderRepositoryQueryInterface | |||||
{ | { | ||||
public function __construct(ReminderRepositoryInterface $repository, PaginatorInterface $paginator) | public function __construct(ReminderRepositoryInterface $repository, PaginatorInterface $paginator) | ||||
{ | { |
<?php | |||||
namespace Lc\SovBundle\Repository\Reminder; | |||||
interface ReminderRepositoryQueryInterface | |||||
{ | |||||
} |
namespace Lc\SovBundle\Repository\Reminder; | 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; | $this->query = $query; | ||||
} | } |
<?php | |||||
namespace Lc\SovBundle\Repository\Reminder; | |||||
interface ReminderStoreInterface | |||||
{ | |||||
} |
<?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); | |||||
} | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Repository\Ticket; | |||||
interface TicketRepositoryQueryInterface | |||||
{ | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Repository\Ticket; | |||||
class TicketStore implements TicketStoreInterface | |||||
{ | |||||
protected TicketRepositoryQueryInterface $query; | |||||
public function __construct(TicketRepositoryQueryInterface $query) | |||||
{ | |||||
$this->query = $query; | |||||
} | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Repository\Ticket; | |||||
interface TicketStoreInterface | |||||
{ | |||||
} |
namespace Lc\SovBundle\Twig; | 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\Repository\Reminder\ReminderStore; | ||||
use Lc\SovBundle\Translation\TranslatorAdmin; | use Lc\SovBundle\Translation\TranslatorAdmin; | ||||
use Liip\ImagineBundle\Imagine\Cache\CacheManager; | |||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; | use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; | ||||
use Symfony\Component\HttpFoundation\RequestStack; | use Symfony\Component\HttpFoundation\RequestStack; | ||||
use Symfony\Component\HttpKernel\KernelInterface; | |||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface; | use Symfony\Component\Routing\Generator\UrlGeneratorInterface; | ||||
use Symfony\Component\Security\Core\Security; | |||||
use Symfony\Contracts\Translation\TranslatorInterface; | |||||
use Twig\Extension\AbstractExtension; | use Twig\Extension\AbstractExtension; | ||||
use Twig\TwigFilter; | use Twig\TwigFilter; | ||||
use Twig\TwigFunction; | use Twig\TwigFunction; |
use App\Repository\ReminderRepository; | use App\Repository\ReminderRepository; | ||||
use Doctrine\ORM\EntityManagerInterface; | use Doctrine\ORM\EntityManagerInterface; | ||||
use Lc\SovBundle\Model\Reminder\ReminderInterface; | |||||
use Lc\SovBundle\Repository\Reminder\ReminderStore; | use Lc\SovBundle\Repository\Reminder\ReminderStore; | ||||
use Lc\SovBundle\Translation\TranslatorAdmin; | use Lc\SovBundle\Translation\TranslatorAdmin; | ||||
use Liip\ImagineBundle\Imagine\Cache\CacheManager; | use Liip\ImagineBundle\Imagine\Cache\CacheManager; |