]> Raphaël G. Git Repositories - airbundle/commitdiff
Remove translator dependency
authorRaphaël Gertz <git@rapsys.eu>
Wed, 9 Dec 2020 20:39:45 +0000 (21:39 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Wed, 9 Dec 2020 20:39:45 +0000 (21:39 +0100)
Form/SessionEditType.php
Resources/config/packages/rapsys_air.yaml

index 24a15446c4fcfecec6e20ae6d8fe32479573ecbd..f5b7317710aaf47bfd68c1696ff50d7010081cca 100644 (file)
@@ -19,15 +19,11 @@ class SessionEditType extends AbstractType {
        //Doctrine instance
        private $doctrine;
 
-       //Translator instance
-       protected $translator;
-
        /**
         * {@inheritdoc}
         */
-       public function __construct(RegistryInterface $doctrine, TranslatorInterface $translator) {
+       public function __construct(RegistryInterface $doctrine) {
                $this->doctrine = $doctrine;
-               $this->translator = $translator;
        }
 
        /**
@@ -61,7 +57,7 @@ class SessionEditType extends AbstractType {
                //Is admin or senior owner
                if (!empty($options['move'])) {
                        //Load locations
-                       $locations = $this->doctrine->getRepository(Location::class)->findComplementBySessionId($this->translator, $options['session']);
+                       $locations = $this->doctrine->getRepository(Location::class)->findComplementBySessionId($options['session']);
                        $builder
                                //TODO: class senior en orange ???
                                ->add('location', ChoiceType::class, ['attr' => ['placeholder' => 'Your location'], 'constraints' => [new NotBlank(['message' => 'Please provide your location'])], 'choices' => $locations, 'choice_translation_domain' => true])
index b5676111089ae82d444060d7c7ad5b7c9cb2005f..49658f5bba724af58a544d5cd28bb136350e84de 100644 (file)
@@ -272,7 +272,7 @@ services:
         arguments: [ '@doctrine', '@translator' ]
         tags: [ 'form.type' ]
     Rapsys\AirBundle\Form\SessionEditType:
-        arguments: [ '@doctrine', '@translator' ]
+        arguments: [ '@doctrine' ]
         tags: [ 'form.type' ]
     Rapsys\AirBundle\Command\AttributeCommand:
         arguments: [ '@doctrine' ]