Browse Source

Repository

develop
Guillaume 3 years ago
parent
commit
de6c30fff2
60 changed files with 526 additions and 54 deletions
  1. +4
    -4
      Controller/Setting/SettingAdminController.php
  2. +4
    -4
      EventSubscriber/SiteSettingEventSubscriber.php
  3. +125
    -0
      Maker/RepositoryMaker.php
  4. +1
    -1
      Repository/File/FileRepository.php
  5. +14
    -0
      Repository/File/FileRepositoryQuery.php
  6. +8
    -0
      Repository/File/FileRepositoryQueryInterface.php
  7. +13
    -0
      Repository/File/FileStore.php
  8. +2
    -2
      Repository/File/FileStoreInterface.php
  9. +1
    -1
      Repository/Newsletter/NewsletterRepository.php
  10. +14
    -0
      Repository/Newsletter/NewsletterRepositoryQuery.php
  11. +8
    -0
      Repository/Newsletter/NewsletterRepositoryQueryInterface.php
  12. +13
    -0
      Repository/Newsletter/NewsletterStore.php
  13. +2
    -2
      Repository/Newsletter/NewsletterStoreInterface.php
  14. +1
    -1
      Repository/Reminder/ReminderRepository.php
  15. +0
    -8
      Repository/Reminder/ReminderRepositoryInterface.php
  16. +1
    -1
      Repository/Reminder/ReminderRepositoryQuery.php
  17. +1
    -1
      Repository/Setting/SiteSettingRepository.php
  18. +14
    -0
      Repository/Setting/SiteSettingRepositoryQuery.php
  19. +8
    -0
      Repository/Setting/SiteSettingRepositoryQueryInterface.php
  20. +13
    -0
      Repository/Setting/SiteSettingStore.php
  21. +2
    -2
      Repository/Setting/SiteSettingStoreInterface.php
  22. +1
    -1
      Repository/Site/NewsRepository.php
  23. +14
    -0
      Repository/Site/NewsRepositoryQuery.php
  24. +8
    -0
      Repository/Site/NewsRepositoryQueryInterface.php
  25. +13
    -0
      Repository/Site/NewsStore.php
  26. +2
    -2
      Repository/Site/NewsStoreInterface.php
  27. +1
    -1
      Repository/Site/PageRepository.php
  28. +14
    -0
      Repository/Site/PageRepositoryQuery.php
  29. +8
    -0
      Repository/Site/PageRepositoryQueryInterface.php
  30. +13
    -0
      Repository/Site/PageStore.php
  31. +2
    -2
      Repository/Site/PageStoreInterface.php
  32. +1
    -1
      Repository/Site/SiteRepository.php
  33. +14
    -0
      Repository/Site/SiteRepositoryQuery.php
  34. +8
    -0
      Repository/Site/SiteRepositoryQueryInterface.php
  35. +13
    -0
      Repository/Site/SiteStore.php
  36. +2
    -2
      Repository/Site/SiteStoreInterface.php
  37. +1
    -1
      Repository/Ticket/TicketMessageRepository.php
  38. +14
    -0
      Repository/Ticket/TicketMessageRepositoryQuery.php
  39. +2
    -2
      Repository/Ticket/TicketMessageRepositoryQueryInterface.php
  40. +13
    -0
      Repository/Ticket/TicketMessageStore.php
  41. +2
    -2
      Repository/Ticket/TicketMessageStoreInterface.php
  42. +1
    -1
      Repository/Ticket/TicketRepository.php
  43. +1
    -1
      Repository/Ticket/TicketRepositoryQuery.php
  44. +1
    -1
      Repository/Ticket/TicketRepositoryQueryInterface.php
  45. +0
    -1
      Repository/Ticket/TicketStore.php
  46. +1
    -1
      Repository/Ticket/TicketStoreInterface.php
  47. +1
    -1
      Repository/User/GroupUserRepository.php
  48. +14
    -0
      Repository/User/GroupUserRepositoryQuery.php
  49. +8
    -0
      Repository/User/GroupUserRepositoryQueryInterface.php
  50. +13
    -0
      Repository/User/GroupUserStore.php
  51. +2
    -2
      Repository/User/GroupUserStoreInterface.php
  52. +2
    -3
      Repository/User/UserRepository.php
  53. +14
    -0
      Repository/User/UserRepositoryQuery.php
  54. +2
    -2
      Repository/User/UserRepositoryQueryInterface.php
  55. +13
    -0
      Repository/User/UserStore.php
  56. +8
    -0
      Repository/User/UserStoreInterface.php
  57. +8
    -0
      Resources/maker/repository/interface.tpl.php
  58. +15
    -0
      Resources/maker/repository/repository.tpl.php
  59. +14
    -0
      Resources/maker/repository/repository_query.tpl.php
  60. +13
    -0
      Resources/maker/repository/store.tpl.php

+ 4
- 4
Controller/Setting/SettingAdminController.php View File

@@ -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;

+ 4
- 4
EventSubscriber/SiteSettingEventSubscriber.php View File

@@ -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

+ 125
- 0
Maker/RepositoryMaker.php View File

@@ -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'
);
}
}

+ 1
- 1
Repository/File/FileRepository.php View File

@@ -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)
{

+ 14
- 0
Repository/File/FileRepositoryQuery.php View File

@@ -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);
}
}

+ 8
- 0
Repository/File/FileRepositoryQueryInterface.php View File

@@ -0,0 +1,8 @@
<?php

namespace Lc\SovBundle\Repository\File;

interface FileRepositoryQueryInterface
{

}

+ 13
- 0
Repository/File/FileStore.php View File

@@ -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;
}
}

Repository/File/FileRepositoryInterface.php → Repository/File/FileStoreInterface.php View File

@@ -2,7 +2,7 @@

namespace Lc\SovBundle\Repository\File;

interface FileRepositoryInterface
interface FileStoreInterface
{

}
}

+ 1
- 1
Repository/Newsletter/NewsletterRepository.php View File

@@ -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)
{

+ 14
- 0
Repository/Newsletter/NewsletterRepositoryQuery.php View File

@@ -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);
}
}

+ 8
- 0
Repository/Newsletter/NewsletterRepositoryQueryInterface.php View File

@@ -0,0 +1,8 @@
<?php

namespace Lc\SovBundle\Repository\Newsletter;

interface NewsletterRepositoryQueryInterface
{

}

+ 13
- 0
Repository/Newsletter/NewsletterStore.php View File

@@ -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;
}
}

Repository/Newsletter/NewsletterRepositoryInterface.php → Repository/Newsletter/NewsletterStoreInterface.php View File

@@ -2,7 +2,7 @@

namespace Lc\SovBundle\Repository\Newsletter;

interface NewsletterRepositoryInterface
interface NewsletterStoreInterface
{

}
}

+ 1
- 1
Repository/Reminder/ReminderRepository.php View File

@@ -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)
{

+ 0
- 8
Repository/Reminder/ReminderRepositoryInterface.php View File

@@ -1,8 +0,0 @@
<?php

namespace Lc\SovBundle\Repository\Reminder;

interface ReminderRepositoryInterface
{

}

+ 1
- 1
Repository/Reminder/ReminderRepositoryQuery.php View File

@@ -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);
}

+ 1
- 1
Repository/Setting/SiteSettingRepository.php View File

@@ -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)
{

+ 14
- 0
Repository/Setting/SiteSettingRepositoryQuery.php View File

@@ -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);
}
}

+ 8
- 0
Repository/Setting/SiteSettingRepositoryQueryInterface.php View File

@@ -0,0 +1,8 @@
<?php

namespace Lc\SovBundle\Repository\Setting;

interface SiteSettingRepositoryQueryInterface
{

}

+ 13
- 0
Repository/Setting/SiteSettingStore.php View File

@@ -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;
}
}

Repository/Setting/SiteSettingRepositoryInterface.php → Repository/Setting/SiteSettingStoreInterface.php View File

@@ -2,7 +2,7 @@

namespace Lc\SovBundle\Repository\Setting;

interface SiteSettingRepositoryInterface
interface SiteSettingStoreInterface
{

}
}

+ 1
- 1
Repository/Site/NewsRepository.php View File

@@ -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)
{

+ 14
- 0
Repository/Site/NewsRepositoryQuery.php View File

@@ -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);
}
}

+ 8
- 0
Repository/Site/NewsRepositoryQueryInterface.php View File

@@ -0,0 +1,8 @@
<?php

namespace Lc\SovBundle\Repository\Site;

interface NewsRepositoryQueryInterface
{

}

+ 13
- 0
Repository/Site/NewsStore.php View File

@@ -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;
}
}

Repository/Site/NewsRepositoryInterface.php → Repository/Site/NewsStoreInterface.php View File

@@ -2,7 +2,7 @@

namespace Lc\SovBundle\Repository\Site;

interface NewsRepositoryInterface
interface NewsStoreInterface
{

}
}

+ 1
- 1
Repository/Site/PageRepository.php View File

@@ -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)
{

+ 14
- 0
Repository/Site/PageRepositoryQuery.php View File

@@ -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);
}
}

+ 8
- 0
Repository/Site/PageRepositoryQueryInterface.php View File

@@ -0,0 +1,8 @@
<?php

namespace Lc\SovBundle\Repository\Site;

interface PageRepositoryQueryInterface
{

}

+ 13
- 0
Repository/Site/PageStore.php View File

@@ -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;
}
}

Repository/Site/SiteRepositoryInterface.php → Repository/Site/PageStoreInterface.php View File

@@ -2,7 +2,7 @@

namespace Lc\SovBundle\Repository\Site;

interface SiteRepositoryInterface
interface PageStoreInterface
{

}
}

+ 1
- 1
Repository/Site/SiteRepository.php View File

@@ -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)
{

+ 14
- 0
Repository/Site/SiteRepositoryQuery.php View File

@@ -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);
}
}

+ 8
- 0
Repository/Site/SiteRepositoryQueryInterface.php View File

@@ -0,0 +1,8 @@
<?php

namespace Lc\SovBundle\Repository\Site;

interface SiteRepositoryQueryInterface
{

}

+ 13
- 0
Repository/Site/SiteStore.php View File

@@ -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;
}
}

Repository/Site/PageRepositoryInterface.php → Repository/Site/SiteStoreInterface.php View File

@@ -2,7 +2,7 @@

namespace Lc\SovBundle\Repository\Site;

interface PageRepositoryInterface
interface SiteStoreInterface
{

}
}

+ 1
- 1
Repository/Ticket/TicketMessageRepository.php View File

@@ -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)
{

+ 14
- 0
Repository/Ticket/TicketMessageRepositoryQuery.php View File

@@ -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);
}
}

Repository/Ticket/TicketMessageRepositoryInterface.php → Repository/Ticket/TicketMessageRepositoryQueryInterface.php View File

@@ -2,7 +2,7 @@

namespace Lc\SovBundle\Repository\Ticket;

interface TicketMessageRepositoryInterface
interface TicketMessageRepositoryQueryInterface
{

}
}

+ 13
- 0
Repository/Ticket/TicketMessageStore.php View File

@@ -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;
}
}

Repository/Ticket/TicketRepositoryInterface.php → Repository/Ticket/TicketMessageStoreInterface.php View File

@@ -2,7 +2,7 @@

namespace Lc\SovBundle\Repository\Ticket;

interface TicketRepositoryInterface
interface TicketMessageStoreInterface
{

}
}

+ 1
- 1
Repository/Ticket/TicketRepository.php View File

@@ -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)
{

+ 1
- 1
Repository/Ticket/TicketRepositoryQuery.php View File

@@ -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);
}

+ 1
- 1
Repository/Ticket/TicketRepositoryQueryInterface.php View File

@@ -5,4 +5,4 @@ namespace Lc\SovBundle\Repository\Ticket;
interface TicketRepositoryQueryInterface
{

}
}

+ 0
- 1
Repository/Ticket/TicketStore.php View File

@@ -10,5 +10,4 @@ class TicketStore implements TicketStoreInterface
{
$this->query = $query;
}

}

+ 1
- 1
Repository/Ticket/TicketStoreInterface.php View File

@@ -5,4 +5,4 @@ namespace Lc\SovBundle\Repository\Ticket;
interface TicketStoreInterface
{

}
}

+ 1
- 1
Repository/User/GroupUserRepository.php View File

@@ -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)
{

+ 14
- 0
Repository/User/GroupUserRepositoryQuery.php View File

@@ -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);
}
}

+ 8
- 0
Repository/User/GroupUserRepositoryQueryInterface.php View File

@@ -0,0 +1,8 @@
<?php

namespace Lc\SovBundle\Repository\User;

interface GroupUserRepositoryQueryInterface
{

}

+ 13
- 0
Repository/User/GroupUserStore.php View File

@@ -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;
}
}

Repository/User/UserRepositoryInterface.php → Repository/User/GroupUserStoreInterface.php View File

@@ -2,7 +2,7 @@

namespace Lc\SovBundle\Repository\User;

interface UserRepositoryInterface
interface GroupUserStoreInterface
{

}
}

+ 2
- 3
Repository/User/UserRepository.php View File

@@ -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();
}

}

+ 14
- 0
Repository/User/UserRepositoryQuery.php View File

@@ -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);
}
}

Repository/User/GroupUserRepositoryInterface.php → Repository/User/UserRepositoryQueryInterface.php View File

@@ -2,7 +2,7 @@

namespace Lc\SovBundle\Repository\User;

interface GroupUserRepositoryInterface
interface UserRepositoryQueryInterface
{

}
}

+ 13
- 0
Repository/User/UserStore.php View File

@@ -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;
}
}

+ 8
- 0
Repository/User/UserStoreInterface.php View File

@@ -0,0 +1,8 @@
<?php

namespace Lc\SovBundle\Repository\User;

interface UserStoreInterface
{

}

+ 8
- 0
Resources/maker/repository/interface.tpl.php View File

@@ -0,0 +1,8 @@
<?= "<?php\n" ?>

namespace <?= $namespace_path; ?>\<?= $domain; ?>;

interface <?= $interface_name; ?>
{

}

+ 15
- 0
Resources/maker/repository/repository.tpl.php View File

@@ -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);
}
}

+ 14
- 0
Resources/maker/repository/repository_query.tpl.php View File

@@ -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);
}
}

+ 13
- 0
Resources/maker/repository/store.tpl.php View File

@@ -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;
}
}

Loading…
Cancel
Save