use Psr\Container\ContainerInterface;
+use Rapsys\PackBundle\Util\FileUtil;
use Rapsys\PackBundle\Util\SluggerUtil;
use Rapsys\UserBundle\Factory as BaseFactory;
/**
* This factory is used to create default repository objects for entities at runtime.
*/
-final class Factory extends BaseFactory {
+class Factory extends BaseFactory {
/**
* Initializes a new RepositoryFactory instance
*
* @param ContainerInterface $container The container instance
+ * @param FileUtil $file The FileUtil instance
* @param RequestStack $request The request stack
* @param RouterInterface $router The router instance
* @param SluggerUtil $slugger The SluggerUtil instance
* @param string $locale The current locale
* @param array $languages The languages list
*/
- public function __construct(private ContainerInterface $container, private RequestStack $request, private RouterInterface $router, private SluggerUtil $slugger, private TranslatorInterface $translator, private string $locale, private array $languages) {
+ public function __construct(protected ContainerInterface $container, protected FileUtil $file, protected RequestStack $request, protected RouterInterface $router, protected SluggerUtil $slugger, protected TranslatorInterface $translator, protected string $locale, protected array $languages) {
}
/**
//Return repository class instance
//XXX: router, slugger, translator, languages and locale arguments will be ignored by default
- return new $repositoryClass($entityManager, $metadata, $this->container, $this->router, $this->slugger, $this->translator, $this->locale, $this->languages);
+ return new $repositoryClass($entityManager, $metadata, $this->container, $this->file, $this->router, $this->slugger, $this->translator, $this->locale, $this->languages);
}
}
use Psr\Container\ContainerInterface;
+use Rapsys\PackBundle\Util\FileUtil;
use Rapsys\PackBundle\Util\SluggerUtil;
use Symfony\Component\Routing\RouterInterface;
* @param EntityManagerInterface $manager The EntityManagerInterface instance
* @param ClassMetadata $class The ClassMetadata instance
* @param ContainerInterface $container The container instance
+ * @param FileUtil $file The FileUtil instance
* @param RouterInterface $router The router instance
* @param SluggerUtil $slugger The SluggerUtil instance
* @param TranslatorInterface $translator The TranslatorInterface instance
* @param string $locale The current locale
* @param array $languages The languages list
*/
- public function __construct(protected EntityManagerInterface $manager, protected ClassMetadata $class, protected ContainerInterface $container, protected RouterInterface $router, protected SluggerUtil $slugger, protected TranslatorInterface $translator, protected string $locale, protected array $languages) {
+ public function __construct(protected EntityManagerInterface $manager, protected ClassMetadata $class, protected ContainerInterface $container, protected FileUtil $file, protected RouterInterface $router, protected SluggerUtil $slugger, protected TranslatorInterface $translator, protected string $locale, protected array $languages) {
//Call parent constructor
parent::__construct($this->manager, $this->class);
use Psr\Container\ContainerInterface;
+use Rapsys\PackBundle\Util\FileUtil;
use Rapsys\PackBundle\Util\SluggerUtil;
use Rapsys\UserBundle\Repository\UserRepository as BaseUserRepository;
* {@inheritdoc}
* @param array $languages The languages list
*/
- public function __construct(protected EntityManagerInterface $manager, protected ClassMetadata $class, protected ContainerInterface $container, protected RouterInterface $router, protected SluggerUtil $slugger, protected TranslatorInterface $translator, protected string $locale, protected array $languages) {
+ public function __construct(protected EntityManagerInterface $manager, protected ClassMetadata $class, protected ContainerInterface $container, protected FileUtil $file, protected RouterInterface $router, protected SluggerUtil $slugger, protected TranslatorInterface $translator, protected string $locale, protected array $languages) {
//Call parent constructor
parent::__construct($manager, $class, $container, $router, $slugger, $translator, $locale);
}
tags: [ 'controller.service_arguments' ]
# Register tree repository factory
Rapsys\TreeBundle\Factory:
- arguments: [ '@service_container', '@request_stack', '@router', '@rapsyspack.slugger_util', '@translator', '%rapsystree.locale%', '%rapsystree.languages%' ]
+ arguments: [ '@service_container', '@rapsyspack.file_util', '@request_stack', '@router', '@rapsyspack.slugger_util', '@translator', '%rapsystree.locale%', '%rapsystree.languages%' ]
#Register blog fixture
Rapsys\TreeBundle\Fixture\TreeFixture:
arguments: [ '@service_container', '@rapsyspack.slugger_util' ]