$datagridMapper->add('roles');
$datagridMapper
->add(
'roles',
CallbackFilter::class,
[
'operator_type' => TextType::class,
'callback' => [$this, 'filterByRoles'],
]
);
$datagridMapper->add(
'roles',
CallbackFilter::class,
[
'operator_type' => ChoiceType::class,
'callback' => [$this, 'filterByRoles'],
'operator_options' => [
'choices'=> [
"contains" => 1,
"not contains" => 2,
"is equals to" => 3,
],
],
],
ChoiceType::class,
[
'choices' => [
'USER' => 'ROLE_USER',
'ADMIN' => 'ROLE_ADMIN',
'SUPPORTER' => 'ROLE_SUPPORTER',
'COPYWRITER' => 'ROLE_COPYWRITER',
'SUPER_ADMIN' => 'ROLE_SUPER_ADMIN',
],
'multiple' => true,
]
);
->add('role', ChoiceType::class, [
'choices' => [
'Пользователь' => Role::ROLE_USER,
'Автор' => Role::ROLE_AUTHOR,
'Редактор' => Role::ROLE_EDITOR,
'Главред' => Role::ROLE_CHIEF_EDITOR,
'Администратор' => Role::ROLE_ADMIN,
],
'required' => false,
'placeholder' => 'Роль',
])