fix deprecations: use fqcn for entity, ComposedGroupCenterType.

This commit is contained in:
nobohan
2018-04-04 11:07:49 +02:00
parent 1b16b8e1da
commit 51a1b23e0d
3 changed files with 12 additions and 7 deletions

View File

@@ -22,6 +22,8 @@ namespace Chill\MainBundle\Form\Type;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Chill\MainBundle\Entity\PermissionsGroup;
use Chill\MainBundle\Entity\Center;
@@ -35,12 +37,12 @@ class ComposedGroupCenterType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('permissionsgroup', 'entity', array(
$builder->add('permissionsgroup', EntityType::class, array(
'class' => 'Chill\MainBundle\Entity\PermissionsGroup',
'choice_label' => function(PermissionsGroup $group) {
return $group->getName();
}
))->add('center', 'entity', array(
))->add('center', EntityType::class, array(
'class' => 'Chill\MainBundle\Entity\Center',
'choice_label' => function(Center $center) {
return $center->getName();

View File

@@ -23,13 +23,16 @@ namespace Chill\MainBundle\Form\Type;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\MainBundle\Entity\Scope;
use Chill\MainBundle\Security\RoleProvider;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\MainBundle\Entity\Scope;
use Chill\MainBundle\Security\RoleProvider;
/**
* Form to Edit/create a role scope. If the role scope does not
* exists in the database, he is generated.
@@ -100,7 +103,7 @@ class ComposedRoleScopeType extends AbstractType
return $this->roleProvider->getRoleTitle($role);
}
))
->add('scope', 'entity', array(
->add('scope', EntityType::class, array(
'class' => 'ChillMainBundle:Scope',
'choice_label' => function(Scope $scope) use ($translatableStringHelper) {
return $translatableStringHelper->localize($scope->getName());