use Doctrine\ORM\EntityManagerInterface; | use Doctrine\ORM\EntityManagerInterface; | ||||
use Lc\SovBundle\Definition\SiteSettingDefinitionInterface; | use Lc\SovBundle\Definition\SiteSettingDefinitionInterface; | ||||
use Lc\SovBundle\Form\Setting\SiteSettingsFormType; | 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 Lc\SovBundle\Translation\TranslatorAdmin; | ||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | ||||
use Symfony\Component\HttpFoundation\Request; | use Symfony\Component\HttpFoundation\Request; | ||||
public function __construct( | public function __construct( | ||||
EntityManagerInterface $em, | EntityManagerInterface $em, | ||||
TranslatorAdmin $translatorAdmin, | TranslatorAdmin $translatorAdmin, | ||||
SiteSettingRepositoryInterface $siteSettingRepository, | |||||
SiteSettingRepository $siteSettingRepository, | |||||
SiteSettingDefinitionInterface $siteSettingDefinition, | SiteSettingDefinitionInterface $siteSettingDefinition, | ||||
SiteRepositoryInterface $siteRepository | |||||
SiteRepository $siteRepository | |||||
) { | ) { | ||||
$this->em = $em; | $this->em = $em; | ||||
$this->translatorAdmin = $translatorAdmin; | $this->translatorAdmin = $translatorAdmin; |
use Lc\SovBundle\Definition\SiteSettingDefinitionInterface; | use Lc\SovBundle\Definition\SiteSettingDefinitionInterface; | ||||
use Lc\SovBundle\Factory\Setting\SiteSettingFactory; | use Lc\SovBundle\Factory\Setting\SiteSettingFactory; | ||||
use Lc\SovBundle\Factory\Site\SiteFactory; | 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\EventDispatcher\EventSubscriberInterface; | ||||
use Symfony\Component\HttpKernel\KernelEvents; | use Symfony\Component\HttpKernel\KernelEvents; | ||||
public function __construct( | public function __construct( | ||||
EntityManagerInterface $em, | EntityManagerInterface $em, | ||||
SiteSettingRepositoryInterface $siteSettingRepository, | |||||
SiteRepositoryInterface $siteRepository, | |||||
SiteSettingRepository $siteSettingRepository, | |||||
SiteRepository $siteRepository, | |||||
SiteSettingDefinitionInterface $siteSettingDefinition, | SiteSettingDefinitionInterface $siteSettingDefinition, | ||||
SiteSettingFactory $siteSettingFactory, | SiteSettingFactory $siteSettingFactory, | ||||
SiteFactory $siteFactory | SiteFactory $siteFactory |
<?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' | |||||
); | |||||
} | |||||
} |
use Doctrine\Persistence\ManagerRegistry; | use Doctrine\Persistence\ManagerRegistry; | ||||
use Lc\SovBundle\Repository\AbstractRepository; | use Lc\SovBundle\Repository\AbstractRepository; | ||||
class FileRepository extends AbstractRepository implements FileRepositoryInterface | |||||
class FileRepository extends AbstractRepository | |||||
{ | { | ||||
public function __construct(ManagerRegistry $registry) | public function __construct(ManagerRegistry $registry) | ||||
{ | { |
<?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); | |||||
} | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Repository\File; | |||||
interface FileRepositoryQueryInterface | |||||
{ | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Repository\File; | |||||
class FileStore implements FileStoreInterface | |||||
{ | |||||
protected FileRepositoryQueryInterface $query; | |||||
public function __construct(FileRepositoryQueryInterface $query) | |||||
{ | |||||
$this->query = $query; | |||||
} | |||||
} |
namespace Lc\SovBundle\Repository\File; | namespace Lc\SovBundle\Repository\File; | ||||
interface FileRepositoryInterface | |||||
interface FileStoreInterface | |||||
{ | { | ||||
} | |||||
} |
use Doctrine\Persistence\ManagerRegistry; | use Doctrine\Persistence\ManagerRegistry; | ||||
use Lc\SovBundle\Repository\AbstractRepository; | use Lc\SovBundle\Repository\AbstractRepository; | ||||
class NewsletterRepository extends AbstractRepository implements NewsletterRepositoryInterface | |||||
class NewsletterRepository extends AbstractRepository | |||||
{ | { | ||||
public function __construct(ManagerRegistry $registry) | public function __construct(ManagerRegistry $registry) | ||||
{ | { |
<?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); | |||||
} | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Repository\Newsletter; | |||||
interface NewsletterRepositoryQueryInterface | |||||
{ | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Repository\Newsletter; | |||||
class NewsletterStore implements NewsletterStoreInterface | |||||
{ | |||||
protected NewsletterRepositoryQueryInterface $query; | |||||
public function __construct(NewsletterRepositoryQueryInterface $query) | |||||
{ | |||||
$this->query = $query; | |||||
} | |||||
} |
namespace Lc\SovBundle\Repository\Newsletter; | namespace Lc\SovBundle\Repository\Newsletter; | ||||
interface NewsletterRepositoryInterface | |||||
interface NewsletterStoreInterface | |||||
{ | { | ||||
} | |||||
} |
use Doctrine\Persistence\ManagerRegistry; | use Doctrine\Persistence\ManagerRegistry; | ||||
use Lc\SovBundle\Repository\AbstractRepository; | use Lc\SovBundle\Repository\AbstractRepository; | ||||
class ReminderRepository extends AbstractRepository implements ReminderRepositoryInterface | |||||
class ReminderRepository extends AbstractRepository | |||||
{ | { | ||||
public function __construct(ManagerRegistry $registry) | public function __construct(ManagerRegistry $registry) | ||||
{ | { |
<?php | |||||
namespace Lc\SovBundle\Repository\Reminder; | |||||
interface ReminderRepositoryInterface | |||||
{ | |||||
} |
class ReminderRepositoryQuery extends AbstractRepositoryQuery implements ReminderRepositoryQueryInterface | 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); | parent::__construct($repository, 'r', $paginator); | ||||
} | } |
use Doctrine\Persistence\ManagerRegistry; | use Doctrine\Persistence\ManagerRegistry; | ||||
use Lc\SovBundle\Repository\AbstractRepository; | use Lc\SovBundle\Repository\AbstractRepository; | ||||
class SiteSettingRepository extends AbstractRepository implements SiteSettingRepositoryInterface | |||||
class SiteSettingRepository extends AbstractRepository | |||||
{ | { | ||||
public function __construct(ManagerRegistry $registry) | public function __construct(ManagerRegistry $registry) | ||||
{ | { |
<?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); | |||||
} | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Repository\Setting; | |||||
interface SiteSettingRepositoryQueryInterface | |||||
{ | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Repository\Setting; | |||||
class SiteSettingStore implements SiteSettingStoreInterface | |||||
{ | |||||
protected SiteSettingRepositoryQueryInterface $query; | |||||
public function __construct(SiteSettingRepositoryQueryInterface $query) | |||||
{ | |||||
$this->query = $query; | |||||
} | |||||
} |
namespace Lc\SovBundle\Repository\Setting; | namespace Lc\SovBundle\Repository\Setting; | ||||
interface SiteSettingRepositoryInterface | |||||
interface SiteSettingStoreInterface | |||||
{ | { | ||||
} | |||||
} |
use Doctrine\Persistence\ManagerRegistry; | use Doctrine\Persistence\ManagerRegistry; | ||||
use Lc\SovBundle\Repository\AbstractRepository; | use Lc\SovBundle\Repository\AbstractRepository; | ||||
class NewsRepository extends AbstractRepository implements NewsRepositoryInterface | |||||
class NewsRepository extends AbstractRepository | |||||
{ | { | ||||
public function __construct(ManagerRegistry $registry) | public function __construct(ManagerRegistry $registry) | ||||
{ | { |
<?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); | |||||
} | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Repository\Site; | |||||
interface NewsRepositoryQueryInterface | |||||
{ | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Repository\Site; | |||||
class NewsStore implements NewsStoreInterface | |||||
{ | |||||
protected NewsRepositoryQueryInterface $query; | |||||
public function __construct(NewsRepositoryQueryInterface $query) | |||||
{ | |||||
$this->query = $query; | |||||
} | |||||
} |
namespace Lc\SovBundle\Repository\Site; | namespace Lc\SovBundle\Repository\Site; | ||||
interface NewsRepositoryInterface | |||||
interface NewsStoreInterface | |||||
{ | { | ||||
} | |||||
} |
use Doctrine\Persistence\ManagerRegistry; | use Doctrine\Persistence\ManagerRegistry; | ||||
use Lc\SovBundle\Repository\AbstractRepository; | use Lc\SovBundle\Repository\AbstractRepository; | ||||
class PageRepository extends AbstractRepository implements PageRepositoryInterface | |||||
class PageRepository extends AbstractRepository | |||||
{ | { | ||||
public function __construct(ManagerRegistry $registry) | public function __construct(ManagerRegistry $registry) | ||||
{ | { |
<?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); | |||||
} | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Repository\Site; | |||||
interface PageRepositoryQueryInterface | |||||
{ | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Repository\Site; | |||||
class PageStore implements PageStoreInterface | |||||
{ | |||||
protected PageRepositoryQueryInterface $query; | |||||
public function __construct(PageRepositoryQueryInterface $query) | |||||
{ | |||||
$this->query = $query; | |||||
} | |||||
} |
namespace Lc\SovBundle\Repository\Site; | namespace Lc\SovBundle\Repository\Site; | ||||
interface SiteRepositoryInterface | |||||
interface PageStoreInterface | |||||
{ | { | ||||
} | |||||
} |
use Doctrine\Persistence\ManagerRegistry; | use Doctrine\Persistence\ManagerRegistry; | ||||
use Lc\SovBundle\Repository\AbstractRepository; | use Lc\SovBundle\Repository\AbstractRepository; | ||||
class SiteRepository extends AbstractRepository implements SiteRepositoryInterface | |||||
class SiteRepository extends AbstractRepository | |||||
{ | { | ||||
public function __construct(ManagerRegistry $registry) | public function __construct(ManagerRegistry $registry) | ||||
{ | { |
<?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); | |||||
} | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Repository\Site; | |||||
interface SiteRepositoryQueryInterface | |||||
{ | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Repository\Site; | |||||
class SiteStore implements SiteStoreInterface | |||||
{ | |||||
protected SiteRepositoryQueryInterface $query; | |||||
public function __construct(SiteRepositoryQueryInterface $query) | |||||
{ | |||||
$this->query = $query; | |||||
} | |||||
} |
namespace Lc\SovBundle\Repository\Site; | namespace Lc\SovBundle\Repository\Site; | ||||
interface PageRepositoryInterface | |||||
interface SiteStoreInterface | |||||
{ | { | ||||
} | |||||
} |
use Doctrine\Persistence\ManagerRegistry; | use Doctrine\Persistence\ManagerRegistry; | ||||
use Lc\SovBundle\Repository\AbstractRepository; | use Lc\SovBundle\Repository\AbstractRepository; | ||||
class TicketMessageRepository extends AbstractRepository implements TicketMessageRepositoryInterface | |||||
class TicketMessageRepository extends AbstractRepository | |||||
{ | { | ||||
public function __construct(ManagerRegistry $registry) | public function __construct(ManagerRegistry $registry) | ||||
{ | { |
<?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); | |||||
} | |||||
} |
namespace Lc\SovBundle\Repository\Ticket; | namespace Lc\SovBundle\Repository\Ticket; | ||||
interface TicketMessageRepositoryInterface | |||||
interface TicketMessageRepositoryQueryInterface | |||||
{ | { | ||||
} | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Repository\Ticket; | |||||
class TicketMessageStore implements TicketMessageStoreInterface | |||||
{ | |||||
protected TicketMessageRepositoryQueryInterface $query; | |||||
public function __construct(TicketMessageRepositoryQueryInterface $query) | |||||
{ | |||||
$this->query = $query; | |||||
} | |||||
} |
namespace Lc\SovBundle\Repository\Ticket; | namespace Lc\SovBundle\Repository\Ticket; | ||||
interface TicketRepositoryInterface | |||||
interface TicketMessageStoreInterface | |||||
{ | { | ||||
} | |||||
} |
use Doctrine\Persistence\ManagerRegistry; | use Doctrine\Persistence\ManagerRegistry; | ||||
use Lc\SovBundle\Repository\AbstractRepository; | use Lc\SovBundle\Repository\AbstractRepository; | ||||
class TicketRepository extends AbstractRepository implements TicketRepositoryInterface | |||||
class TicketRepository extends AbstractRepository | |||||
{ | { | ||||
public function __construct(ManagerRegistry $registry) | public function __construct(ManagerRegistry $registry) | ||||
{ | { |
class TicketRepositoryQuery extends AbstractRepositoryQuery implements TicketRepositoryQueryInterface | 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); | parent::__construct($repository, 'r', $paginator); | ||||
} | } |
interface TicketRepositoryQueryInterface | interface TicketRepositoryQueryInterface | ||||
{ | { | ||||
} | |||||
} |
{ | { | ||||
$this->query = $query; | $this->query = $query; | ||||
} | } | ||||
} | } |
interface TicketStoreInterface | interface TicketStoreInterface | ||||
{ | { | ||||
} | |||||
} |
use Doctrine\Persistence\ManagerRegistry; | use Doctrine\Persistence\ManagerRegistry; | ||||
use Lc\SovBundle\Repository\AbstractRepository; | use Lc\SovBundle\Repository\AbstractRepository; | ||||
class GroupUserRepository extends AbstractRepository implements GroupUserRepositoryInterface | |||||
class GroupUserRepository extends AbstractRepository | |||||
{ | { | ||||
public function __construct(ManagerRegistry $registry) | public function __construct(ManagerRegistry $registry) | ||||
{ | { |
<?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); | |||||
} | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Repository\User; | |||||
interface GroupUserRepositoryQueryInterface | |||||
{ | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Repository\User; | |||||
class GroupUserStore implements GroupUserStoreInterface | |||||
{ | |||||
protected GroupUserRepositoryQueryInterface $query; | |||||
public function __construct(GroupUserRepositoryQueryInterface $query) | |||||
{ | |||||
$this->query = $query; | |||||
} | |||||
} |
namespace Lc\SovBundle\Repository\User; | namespace Lc\SovBundle\Repository\User; | ||||
interface UserRepositoryInterface | |||||
interface GroupUserStoreInterface | |||||
{ | { | ||||
} | |||||
} |
namespace Lc\SovBundle\Repository\User; | namespace Lc\SovBundle\Repository\User; | ||||
use Doctrine\Persistence\ManagerRegistry; | |||||
use App\Entity\User\User; | use App\Entity\User\User; | ||||
use Doctrine\Persistence\ManagerRegistry; | |||||
use Lc\SovBundle\Repository\AbstractRepository; | use Lc\SovBundle\Repository\AbstractRepository; | ||||
use Symfony\Component\Security\Core\Exception\UnsupportedUserException; | use Symfony\Component\Security\Core\Exception\UnsupportedUserException; | ||||
use Symfony\Component\Security\Core\User\UserInterface as SfUserInterface; | use Symfony\Component\Security\Core\User\UserInterface as SfUserInterface; | ||||
class UserRepository extends AbstractRepository implements UserRepositoryInterface | |||||
class UserRepository extends AbstractRepository | |||||
{ | { | ||||
public function __construct(ManagerRegistry $registry) | public function __construct(ManagerRegistry $registry) | ||||
{ | { | ||||
->getQuery() | ->getQuery() | ||||
->getResult(); | ->getResult(); | ||||
} | } | ||||
} | } |
<?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); | |||||
} | |||||
} |
namespace Lc\SovBundle\Repository\User; | namespace Lc\SovBundle\Repository\User; | ||||
interface GroupUserRepositoryInterface | |||||
interface UserRepositoryQueryInterface | |||||
{ | { | ||||
} | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Repository\User; | |||||
class UserStore implements UserStoreInterface | |||||
{ | |||||
protected UserRepositoryQueryInterface $query; | |||||
public function __construct(UserRepositoryQueryInterface $query) | |||||
{ | |||||
$this->query = $query; | |||||
} | |||||
} |
<?php | |||||
namespace Lc\SovBundle\Repository\User; | |||||
interface UserStoreInterface | |||||
{ | |||||
} |
<?= "<?php\n" ?> | |||||
namespace <?= $namespace_path; ?>\<?= $domain; ?>; | |||||
interface <?= $interface_name; ?> | |||||
{ | |||||
} |
<?= "<?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); | |||||
} | |||||
} |
<?= "<?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); | |||||
} | |||||
} |
<?= "<?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; | |||||
} | |||||
} |