mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
replace more doctrine shortcuts by fqdn
This commit is contained in:
@@ -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 = [];
|
||||
|
@@ -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 = [];
|
||||
|
Reference in New Issue
Block a user