mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix deprecations: use fqcn for entity, ComposedGroupCenterType.
This commit is contained in:
parent
1b16b8e1da
commit
51a1b23e0d
@ -413,7 +413,7 @@ class UserController extends Controller
|
||||
->setAction($this->generateUrl('admin_user_add_group_center',
|
||||
array('uid' => $user->getId())))
|
||||
->setMethod('POST')
|
||||
->add(self::FORM_GROUP_CENTER_COMPOSED, new ComposedGroupCenterType())
|
||||
->add(self::FORM_GROUP_CENTER_COMPOSED, ComposedGroupCenterType::class)
|
||||
->add('submit', SubmitType::class, array('label' => 'Add a new groupCenter'))
|
||||
->getForm()
|
||||
;
|
||||
|
@ -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();
|
||||
|
@ -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());
|
||||
|
Loading…
x
Reference in New Issue
Block a user