fix deprecations: use fqcn

This commit is contained in:
nobohan 2018-04-04 18:17:51 +02:00
parent 7edd6affe4
commit b07d876157
2 changed files with 9 additions and 8 deletions

View File

@ -28,6 +28,7 @@ use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Bundle\TwigBundle\TwigEngine; use Symfony\Bundle\TwigBundle\TwigEngine;
use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\MainBundle\Templating\TranslatableStringHelper;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Chill\CustomFieldsBundle\Form\Type\CustomFieldsTitleType;
class CustomFieldTitle extends AbstractCustomField class CustomFieldTitle extends AbstractCustomField
{ {
@ -58,7 +59,7 @@ class CustomFieldTitle extends AbstractCustomField
public function buildForm(FormBuilderInterface $builder, CustomField $customField) public function buildForm(FormBuilderInterface $builder, CustomField $customField)
{ {
$builder->add($customField->getSlug(), 'custom_field_title', array( $builder->add($customField->getSlug(), CustomFieldsTitleType::class, array(
'label' => false, 'label' => false,
'attr' => array( 'attr' => array(
'class' => 'cf-title', 'class' => 'cf-title',
@ -105,7 +106,7 @@ class CustomFieldTitle extends AbstractCustomField
array( array(
'choices' => array( 'choices' => array(
'Main title' => self::TYPE_TITLE, 'Main title' => self::TYPE_TITLE,
'Subtitle' => self::TYPE_SUBTITLE 'Subtitle' => self::TYPE_SUBTITLE
), ),
'label' => 'Title level', 'label' => 'Title level',
'choices_as_values' => true 'choices_as_values' => true

View File

@ -1,20 +1,20 @@
<?php <?php
/* /*
* Chill is a software for social workers * Chill is a software for social workers
* *
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop> * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
@ -30,9 +30,9 @@ class CustomFieldsTitleType extends AbstractType
} }
public function getName() public function getBlockPrefix()
{ {
return 'custom_field_title'; return 'custom_field_title';
} }
} }