@@ -5,8 +5,8 @@ namespace Lc\SovBundle\Controller\Setting; | |||
use Doctrine\ORM\EntityManagerInterface; | |||
use Lc\SovBundle\Definition\SiteSettingDefinitionInterface; | |||
use Lc\SovBundle\Form\Setting\SiteSettingsFormType; | |||
use Lc\SovBundle\Repository\Setting\SiteSettingRepositoryInterface; | |||
use Lc\SovBundle\Repository\Site\SiteRepositoryInterface; | |||
use Lc\SovBundle\Repository\Setting\SiteSettingRepository; | |||
use Lc\SovBundle\Repository\Site\SiteRepository; | |||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | |||
use Symfony\Component\HttpFoundation\Request; | |||
@@ -23,9 +23,9 @@ class SettingAdminController extends AbstractController | |||
public function __construct( | |||
EntityManagerInterface $em, | |||
TranslatorAdmin $translatorAdmin, | |||
SiteSettingRepositoryInterface $siteSettingRepository, | |||
SiteSettingRepository $siteSettingRepository, | |||
SiteSettingDefinitionInterface $siteSettingDefinition, | |||
SiteRepositoryInterface $siteRepository | |||
SiteRepository $siteRepository | |||
) { | |||
$this->em = $em; | |||
$this->translatorAdmin = $translatorAdmin; |
@@ -6,8 +6,8 @@ use Doctrine\ORM\EntityManagerInterface; | |||
use Lc\SovBundle\Definition\SiteSettingDefinitionInterface; | |||
use Lc\SovBundle\Factory\Setting\SiteSettingFactory; | |||
use Lc\SovBundle\Factory\Site\SiteFactory; | |||
use Lc\SovBundle\Repository\Setting\SiteSettingRepositoryInterface; | |||
use Lc\SovBundle\Repository\Site\SiteRepositoryInterface; | |||
use Lc\SovBundle\Repository\Setting\SiteSettingRepository; | |||
use Lc\SovBundle\Repository\Site\SiteRepository; | |||
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |||
use Symfony\Component\HttpKernel\KernelEvents; | |||
@@ -22,8 +22,8 @@ class SiteSettingEventSubscriber implements EventSubscriberInterface | |||
public function __construct( | |||
EntityManagerInterface $em, | |||
SiteSettingRepositoryInterface $siteSettingRepository, | |||
SiteRepositoryInterface $siteRepository, | |||
SiteSettingRepository $siteSettingRepository, | |||
SiteRepository $siteRepository, | |||
SiteSettingDefinitionInterface $siteSettingDefinition, | |||
SiteSettingFactory $siteSettingFactory, | |||
SiteFactory $siteFactory |
@@ -0,0 +1,125 @@ | |||
<?php | |||
namespace Lc\SovBundle\Maker; | |||
use Doctrine\Common\Annotations\Annotation; | |||
use Symfony\Bundle\MakerBundle\ConsoleStyle; | |||
use Symfony\Bundle\MakerBundle\DependencyBuilder; | |||
use Symfony\Bundle\MakerBundle\Generator; | |||
use Symfony\Bundle\MakerBundle\InputConfiguration; | |||
use Symfony\Bundle\MakerBundle\Maker\AbstractMaker; | |||
use Symfony\Component\Console\Command\Command; | |||
use Symfony\Component\Console\Input\InputArgument; | |||
use Symfony\Component\Console\Input\InputInterface; | |||
use function Symfony\Component\String\u; | |||
class RepositoryMaker extends AbstractMaker | |||
{ | |||
public static function getCommandName(): string | |||
{ | |||
return 'make:repository'; | |||
} | |||
public static function getCommandDescription(): string | |||
{ | |||
return 'Creates a repository, query and store'; | |||
} | |||
public function configureCommand(Command $command, InputConfiguration $inputConf) | |||
{ | |||
$command | |||
->addArgument( | |||
'namespace', | |||
InputArgument::OPTIONAL, | |||
'Namespace (e.g. <fg=yellow>Lc\SovBundle\Repository</>)' | |||
) | |||
->addArgument( | |||
'domain', | |||
InputArgument::OPTIONAL, | |||
'Domain (e.g. <fg=yellow>Order</>)' | |||
) | |||
->addArgument( | |||
'entity-class', | |||
InputArgument::OPTIONAL, | |||
'Define the entity (e.g. <fg=yellow>MyEntity</>)' | |||
) | |||
->setHelp(''); | |||
} | |||
public function generate(InputInterface $input, ConsoleStyle $io, Generator $generator) | |||
{ | |||
$entityDetails = $generator->createClassNameDetails( | |||
$input->getArgument('entity-class'), | |||
'Entity\\', | |||
'' | |||
); | |||
$options = [ | |||
'namespace_path' => $input->getArgument('namespace'), | |||
'domain' => $input->getArgument('domain'), | |||
'entity_class' => $input->getArgument('entity-class'), | |||
'entity' => $entityDetails->getFullName(), | |||
]; | |||
// repository | |||
$repositoryClass = $input->getArgument('entity-class') . 'Repository'; | |||
$this->generateClass($generator, $repositoryClass, 'Repository\\', 'repository.tpl.php', $options); | |||
// repository query | |||
$repositoryQueryClass = $input->getArgument('entity-class') . 'RepositoryQuery'; | |||
$options['class_name_repository'] = $repositoryClass; | |||
$this->generateClass($generator, $repositoryQueryClass, 'Repository\\', 'repository_query.tpl.php', $options); | |||
// store | |||
$storeClass = $input->getArgument('entity-class') . 'Store'; | |||
$options['class_name_repository_query'] = $repositoryQueryClass; | |||
$this->generateClass($generator, $storeClass, 'Repository\\', 'store.tpl.php', $options); | |||
// interfaces | |||
$this->generateInterface($input, $generator, $repositoryQueryClass . 'Interface'); | |||
$this->generateInterface($input, $generator, $storeClass . 'Interface'); | |||
// write files | |||
$generator->writeChanges(); | |||
$this->writeSuccessMessage($io); | |||
$io->text('Next: Open your new factory class and configure it!'); | |||
} | |||
public function generateClass($generator, $class, $namespacePrefix, $tpl, $options) | |||
{ | |||
$repositoryDetails = $generator->createClassNameDetails( | |||
$class, | |||
$namespacePrefix, | |||
'' | |||
); | |||
$generator->generateController( | |||
$repositoryDetails->getFullName(), | |||
__DIR__ . '/../Resources/maker/repository/'.$tpl, | |||
$options | |||
); | |||
} | |||
public function generateInterface($input, $generator, $interfaceName) | |||
{ | |||
$generator->generateFile( | |||
$generator->getRootDirectory() . '/src/Repository/' . $interfaceName . '.php', | |||
__DIR__ . '/../Resources/maker/repository/interface.tpl.php', | |||
[ | |||
'namespace_path' => $input->getArgument('namespace'), | |||
'domain' => $input->getArgument('domain'), | |||
'interface_name' => $interfaceName, | |||
] | |||
); | |||
} | |||
public function configureDependencies(DependencyBuilder $dependencies) | |||
{ | |||
$dependencies->addClassDependency( | |||
Annotation::class, | |||
'doctrine/annotations' | |||
); | |||
} | |||
} |
@@ -6,7 +6,7 @@ use App\Entity\File\File; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use Lc\SovBundle\Repository\AbstractRepository; | |||
class FileRepository extends AbstractRepository implements FileRepositoryInterface | |||
class FileRepository extends AbstractRepository | |||
{ | |||
public function __construct(ManagerRegistry $registry) | |||
{ |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\File; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class FileRepositoryQuery extends AbstractRepositoryQuery implements FileRepositoryQueryInterface | |||
{ | |||
public function __construct(FileRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\File; | |||
interface FileRepositoryQueryInterface | |||
{ | |||
} |
@@ -0,0 +1,13 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\File; | |||
class FileStore implements FileStoreInterface | |||
{ | |||
protected FileRepositoryQueryInterface $query; | |||
public function __construct(FileRepositoryQueryInterface $query) | |||
{ | |||
$this->query = $query; | |||
} | |||
} |
@@ -2,7 +2,7 @@ | |||
namespace Lc\SovBundle\Repository\File; | |||
interface FileRepositoryInterface | |||
interface FileStoreInterface | |||
{ | |||
} | |||
} |
@@ -6,7 +6,7 @@ use App\Entity\Newsletter\Newsletter; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use Lc\SovBundle\Repository\AbstractRepository; | |||
class NewsletterRepository extends AbstractRepository implements NewsletterRepositoryInterface | |||
class NewsletterRepository extends AbstractRepository | |||
{ | |||
public function __construct(ManagerRegistry $registry) | |||
{ |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Newsletter; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class NewsletterRepositoryQuery extends AbstractRepositoryQuery implements NewsletterRepositoryQueryInterface | |||
{ | |||
public function __construct(NewsletterRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Newsletter; | |||
interface NewsletterRepositoryQueryInterface | |||
{ | |||
} |
@@ -0,0 +1,13 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Newsletter; | |||
class NewsletterStore implements NewsletterStoreInterface | |||
{ | |||
protected NewsletterRepositoryQueryInterface $query; | |||
public function __construct(NewsletterRepositoryQueryInterface $query) | |||
{ | |||
$this->query = $query; | |||
} | |||
} |
@@ -2,7 +2,7 @@ | |||
namespace Lc\SovBundle\Repository\Newsletter; | |||
interface NewsletterRepositoryInterface | |||
interface NewsletterStoreInterface | |||
{ | |||
} | |||
} |
@@ -6,7 +6,7 @@ use App\Entity\Reminder\Reminder; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use Lc\SovBundle\Repository\AbstractRepository; | |||
class ReminderRepository extends AbstractRepository implements ReminderRepositoryInterface | |||
class ReminderRepository extends AbstractRepository | |||
{ | |||
public function __construct(ManagerRegistry $registry) | |||
{ |
@@ -1,8 +0,0 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Reminder; | |||
interface ReminderRepositoryInterface | |||
{ | |||
} |
@@ -7,7 +7,7 @@ use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class ReminderRepositoryQuery extends AbstractRepositoryQuery implements ReminderRepositoryQueryInterface | |||
{ | |||
public function __construct(ReminderRepositoryInterface $repository, PaginatorInterface $paginator) | |||
public function __construct(ReminderRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
} |
@@ -6,7 +6,7 @@ use App\Entity\Setting\SiteSetting; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use Lc\SovBundle\Repository\AbstractRepository; | |||
class SiteSettingRepository extends AbstractRepository implements SiteSettingRepositoryInterface | |||
class SiteSettingRepository extends AbstractRepository | |||
{ | |||
public function __construct(ManagerRegistry $registry) | |||
{ |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Setting; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class SiteSettingRepositoryQuery extends AbstractRepositoryQuery implements SiteSettingRepositoryQueryInterface | |||
{ | |||
public function __construct(SiteSettingRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Setting; | |||
interface SiteSettingRepositoryQueryInterface | |||
{ | |||
} |
@@ -0,0 +1,13 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Setting; | |||
class SiteSettingStore implements SiteSettingStoreInterface | |||
{ | |||
protected SiteSettingRepositoryQueryInterface $query; | |||
public function __construct(SiteSettingRepositoryQueryInterface $query) | |||
{ | |||
$this->query = $query; | |||
} | |||
} |
@@ -2,7 +2,7 @@ | |||
namespace Lc\SovBundle\Repository\Setting; | |||
interface SiteSettingRepositoryInterface | |||
interface SiteSettingStoreInterface | |||
{ | |||
} | |||
} |
@@ -6,7 +6,7 @@ use App\Entity\Site\News; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use Lc\SovBundle\Repository\AbstractRepository; | |||
class NewsRepository extends AbstractRepository implements NewsRepositoryInterface | |||
class NewsRepository extends AbstractRepository | |||
{ | |||
public function __construct(ManagerRegistry $registry) | |||
{ |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Site; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class NewsRepositoryQuery extends AbstractRepositoryQuery implements NewsRepositoryQueryInterface | |||
{ | |||
public function __construct(NewsRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Site; | |||
interface NewsRepositoryQueryInterface | |||
{ | |||
} |
@@ -0,0 +1,13 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Site; | |||
class NewsStore implements NewsStoreInterface | |||
{ | |||
protected NewsRepositoryQueryInterface $query; | |||
public function __construct(NewsRepositoryQueryInterface $query) | |||
{ | |||
$this->query = $query; | |||
} | |||
} |
@@ -2,7 +2,7 @@ | |||
namespace Lc\SovBundle\Repository\Site; | |||
interface NewsRepositoryInterface | |||
interface NewsStoreInterface | |||
{ | |||
} | |||
} |
@@ -6,7 +6,7 @@ use App\Entity\Site\Page; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use Lc\SovBundle\Repository\AbstractRepository; | |||
class PageRepository extends AbstractRepository implements PageRepositoryInterface | |||
class PageRepository extends AbstractRepository | |||
{ | |||
public function __construct(ManagerRegistry $registry) | |||
{ |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Site; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class PageRepositoryQuery extends AbstractRepositoryQuery implements PageRepositoryQueryInterface | |||
{ | |||
public function __construct(PageRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Site; | |||
interface PageRepositoryQueryInterface | |||
{ | |||
} |
@@ -0,0 +1,13 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Site; | |||
class PageStore implements PageStoreInterface | |||
{ | |||
protected PageRepositoryQueryInterface $query; | |||
public function __construct(PageRepositoryQueryInterface $query) | |||
{ | |||
$this->query = $query; | |||
} | |||
} |
@@ -2,7 +2,7 @@ | |||
namespace Lc\SovBundle\Repository\Site; | |||
interface SiteRepositoryInterface | |||
interface PageStoreInterface | |||
{ | |||
} | |||
} |
@@ -6,7 +6,7 @@ use App\Entity\Site\Site; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use Lc\SovBundle\Repository\AbstractRepository; | |||
class SiteRepository extends AbstractRepository implements SiteRepositoryInterface | |||
class SiteRepository extends AbstractRepository | |||
{ | |||
public function __construct(ManagerRegistry $registry) | |||
{ |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Site; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class SiteRepositoryQuery extends AbstractRepositoryQuery implements SiteRepositoryQueryInterface | |||
{ | |||
public function __construct(SiteRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Site; | |||
interface SiteRepositoryQueryInterface | |||
{ | |||
} |
@@ -0,0 +1,13 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Site; | |||
class SiteStore implements SiteStoreInterface | |||
{ | |||
protected SiteRepositoryQueryInterface $query; | |||
public function __construct(SiteRepositoryQueryInterface $query) | |||
{ | |||
$this->query = $query; | |||
} | |||
} |
@@ -2,7 +2,7 @@ | |||
namespace Lc\SovBundle\Repository\Site; | |||
interface PageRepositoryInterface | |||
interface SiteStoreInterface | |||
{ | |||
} | |||
} |
@@ -6,7 +6,7 @@ use App\Entity\Ticket\TicketMessage; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use Lc\SovBundle\Repository\AbstractRepository; | |||
class TicketMessageRepository extends AbstractRepository implements TicketMessageRepositoryInterface | |||
class TicketMessageRepository extends AbstractRepository | |||
{ | |||
public function __construct(ManagerRegistry $registry) | |||
{ |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Ticket; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class TicketMessageRepositoryQuery extends AbstractRepositoryQuery implements TicketMessageRepositoryQueryInterface | |||
{ | |||
public function __construct(TicketMessageRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
} | |||
} |
@@ -2,7 +2,7 @@ | |||
namespace Lc\SovBundle\Repository\Ticket; | |||
interface TicketMessageRepositoryInterface | |||
interface TicketMessageRepositoryQueryInterface | |||
{ | |||
} | |||
} |
@@ -0,0 +1,13 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\Ticket; | |||
class TicketMessageStore implements TicketMessageStoreInterface | |||
{ | |||
protected TicketMessageRepositoryQueryInterface $query; | |||
public function __construct(TicketMessageRepositoryQueryInterface $query) | |||
{ | |||
$this->query = $query; | |||
} | |||
} |
@@ -2,7 +2,7 @@ | |||
namespace Lc\SovBundle\Repository\Ticket; | |||
interface TicketRepositoryInterface | |||
interface TicketMessageStoreInterface | |||
{ | |||
} | |||
} |
@@ -6,7 +6,7 @@ use App\Entity\Ticket\Ticket; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use Lc\SovBundle\Repository\AbstractRepository; | |||
class TicketRepository extends AbstractRepository implements TicketRepositoryInterface | |||
class TicketRepository extends AbstractRepository | |||
{ | |||
public function __construct(ManagerRegistry $registry) | |||
{ |
@@ -7,7 +7,7 @@ use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class TicketRepositoryQuery extends AbstractRepositoryQuery implements TicketRepositoryQueryInterface | |||
{ | |||
public function __construct(TicketRepositoryInterface $repository, PaginatorInterface $paginator) | |||
public function __construct(TicketRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
} |
@@ -5,4 +5,4 @@ namespace Lc\SovBundle\Repository\Ticket; | |||
interface TicketRepositoryQueryInterface | |||
{ | |||
} | |||
} |
@@ -10,5 +10,4 @@ class TicketStore implements TicketStoreInterface | |||
{ | |||
$this->query = $query; | |||
} | |||
} |
@@ -5,4 +5,4 @@ namespace Lc\SovBundle\Repository\Ticket; | |||
interface TicketStoreInterface | |||
{ | |||
} | |||
} |
@@ -6,7 +6,7 @@ use App\Entity\User\GroupUser; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use Lc\SovBundle\Repository\AbstractRepository; | |||
class GroupUserRepository extends AbstractRepository implements GroupUserRepositoryInterface | |||
class GroupUserRepository extends AbstractRepository | |||
{ | |||
public function __construct(ManagerRegistry $registry) | |||
{ |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\User; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class GroupUserRepositoryQuery extends AbstractRepositoryQuery implements GroupUserRepositoryQueryInterface | |||
{ | |||
public function __construct(GroupUserRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\User; | |||
interface GroupUserRepositoryQueryInterface | |||
{ | |||
} |
@@ -0,0 +1,13 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\User; | |||
class GroupUserStore implements GroupUserStoreInterface | |||
{ | |||
protected GroupUserRepositoryQueryInterface $query; | |||
public function __construct(GroupUserRepositoryQueryInterface $query) | |||
{ | |||
$this->query = $query; | |||
} | |||
} |
@@ -2,7 +2,7 @@ | |||
namespace Lc\SovBundle\Repository\User; | |||
interface UserRepositoryInterface | |||
interface GroupUserStoreInterface | |||
{ | |||
} | |||
} |
@@ -2,13 +2,13 @@ | |||
namespace Lc\SovBundle\Repository\User; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use App\Entity\User\User; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use Lc\SovBundle\Repository\AbstractRepository; | |||
use Symfony\Component\Security\Core\Exception\UnsupportedUserException; | |||
use Symfony\Component\Security\Core\User\UserInterface as SfUserInterface; | |||
class UserRepository extends AbstractRepository implements UserRepositoryInterface | |||
class UserRepository extends AbstractRepository | |||
{ | |||
public function __construct(ManagerRegistry $registry) | |||
{ | |||
@@ -36,5 +36,4 @@ class UserRepository extends AbstractRepository implements UserRepositoryInterfa | |||
->getQuery() | |||
->getResult(); | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\User; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class UserRepositoryQuery extends AbstractRepositoryQuery implements UserRepositoryQueryInterface | |||
{ | |||
public function __construct(UserRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
} | |||
} |
@@ -2,7 +2,7 @@ | |||
namespace Lc\SovBundle\Repository\User; | |||
interface GroupUserRepositoryInterface | |||
interface UserRepositoryQueryInterface | |||
{ | |||
} | |||
} |
@@ -0,0 +1,13 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\User; | |||
class UserStore implements UserStoreInterface | |||
{ | |||
protected UserRepositoryQueryInterface $query; | |||
public function __construct(UserRepositoryQueryInterface $query) | |||
{ | |||
$this->query = $query; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\SovBundle\Repository\User; | |||
interface UserStoreInterface | |||
{ | |||
} |
@@ -0,0 +1,8 @@ | |||
<?= "<?php\n" ?> | |||
namespace <?= $namespace_path; ?>\<?= $domain; ?>; | |||
interface <?= $interface_name; ?> | |||
{ | |||
} |
@@ -0,0 +1,15 @@ | |||
<?= "<?php\n" ?> | |||
namespace <?= $namespace_path; ?>\<?= $domain; ?>; | |||
use App\Entity\<?= $domain; ?>\<?= $entity_class ?>; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use Lc\SovBundle\Repository\AbstractRepository; | |||
class <?= $class_name ?> extends AbstractRepository | |||
{ | |||
public function __construct(ManagerRegistry $registry) | |||
{ | |||
parent::__construct($registry, <?= $entity_class ?>::class); | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<?= "<?php\n" ?> | |||
namespace <?= $namespace_path; ?>\<?= $domain; ?>; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class <?= $class_name ?> extends AbstractRepositoryQuery implements <?= $class_name; ?>Interface | |||
{ | |||
public function __construct(<?= $class_name_repository; ?> $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
} | |||
} |
@@ -0,0 +1,13 @@ | |||
<?= "<?php\n" ?> | |||
namespace <?= $namespace_path; ?>\<?= $domain; ?>; | |||
class <?= $class_name ?> implements <?= $class_name ?>Interface | |||
{ | |||
protected <?= $class_name_repository_query ?>Interface $query; | |||
public function __construct(<?= $class_name_repository_query ?>Interface $query) | |||
{ | |||
$this->query = $query; | |||
} | |||
} |