replace more doctrine shortcuts by fqdn

This commit is contained in:
2022-04-30 00:35:11 +02:00
parent a0392b9216
commit 864e1eeabb
19 changed files with 39 additions and 33 deletions

View File

@@ -11,6 +11,7 @@ declare(strict_types=1);
namespace Chill\MainBundle\Form\Type;
use Chill\MainBundle\Entity\Country;
use Chill\MainBundle\Form\Type\DataTransformer\ObjectToIdTransformer;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Doctrine\Persistence\ObjectManager;
@@ -50,13 +51,13 @@ class Select2CountryType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$transformer = new ObjectToIdTransformer($this->em, 'Chill\MainBundle\Entity\Country');
$transformer = new ObjectToIdTransformer($this->em, Country::class);
$builder->addModelTransformer($transformer);
}
public function configureOptions(OptionsResolver $resolver)
{
$countries = $this->em->getRepository('Chill\MainBundle\Entity\Country')->findAll();
$countries = $this->em->getRepository(Country::class)->findAll();
$choices = [];
$preferredCountries = $this->parameterBag->get('chill_main.available_countries');
$preferredChoices = [];

View File

@@ -11,6 +11,7 @@ declare(strict_types=1);
namespace Chill\MainBundle\Form\Type;
use Chill\MainBundle\Entity\Language;
use Chill\MainBundle\Form\Type\DataTransformer\MultipleObjectsToIdTransformer;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Doctrine\Persistence\ObjectManager;
@@ -50,13 +51,13 @@ class Select2LanguageType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$transformer = new MultipleObjectsToIdTransformer($this->em, 'Chill\MainBundle\Entity\Language');
$transformer = new MultipleObjectsToIdTransformer($this->em, Language::class);
$builder->addModelTransformer($transformer);
}
public function configureOptions(OptionsResolver $resolver)
{
$languages = $this->em->getRepository('Chill\MainBundle\Entity\Language')->findAll();
$languages = $this->em->getRepository(Language::class)->findAll();
$preferredLanguages = $this->parameterBag->get('chill_main.available_languages');
$choices = [];
$preferredChoices = [];