fix deprecations: getName -> getBlockPrefix in Forms

This commit is contained in:
nobohan 2018-04-09 10:06:34 +02:00
parent b84a77d9de
commit 96e1b1db4d
7 changed files with 22 additions and 22 deletions

View File

@ -35,7 +35,7 @@ class ActivityReasonCategoryType extends AbstractType
/** /**
* @return string * @return string
*/ */
public function getName() public function getBlockPrefix()
{ {
return 'chill_activitybundle_activityreasoncategory'; return 'chill_activitybundle_activityreasoncategory';
} }

View File

@ -37,7 +37,7 @@ class ActivityReasonType extends AbstractType
/** /**
* @return string * @return string
*/ */
public function getName() public function getBlockPrefix()
{ {
return 'chill_activitybundle_activityreason'; return 'chill_activitybundle_activityreason';
} }

View File

@ -187,7 +187,7 @@ class ActivityType extends AbstractType
/** /**
* @return string * @return string
*/ */
public function getName() public function getBlockPrefix()
{ {
return 'chill_activitybundle_activity'; return 'chill_activitybundle_activity';
} }

View File

@ -41,7 +41,7 @@ class ActivityTypeType extends AbstractType
/** /**
* @return string * @return string
*/ */
public function getName() public function getBlockPrefix()
{ {
return 'chill_activitybundle_activitytype'; return 'chill_activitybundle_activitytype';
} }

View File

@ -43,7 +43,7 @@ class TranslatableActivityReason extends AbstractType
$this->translatableStringHelper = $translatableStringHelper; $this->translatableStringHelper = $translatableStringHelper;
} }
public function getName() public function getBlockPrefix()
{ {
return 'translatable_activity_reason'; return 'translatable_activity_reason';
} }

View File

@ -47,7 +47,7 @@ class TranslatableActivityReasonCategory extends AbstractType
$this->requestStack = $requestStack; $this->requestStack = $requestStack;
} }
public function getName() public function getBlockPrefix()
{ {
return 'translatable_activity_reason_category'; return 'translatable_activity_reason_category';
} }

View File

@ -2,20 +2,20 @@
/* /*
* Chill is a software for social workers * Chill is a software for social workers
* *
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS, * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop> * <http://www.champs-libres.coop>, <info@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/>.
*/ */
@ -37,15 +37,15 @@ use Chill\ActivityBundle\Entity\ActivityType;
*/ */
class TranslatableActivityType extends AbstractType class TranslatableActivityType extends AbstractType
{ {
/** /**
* *
* @var TranslatableStringHelper * @var TranslatableStringHelper
*/ */
protected $translatableStringHelper; protected $translatableStringHelper;
protected $activityTypeRepository; protected $activityTypeRepository;
public function __construct( public function __construct(
TranslatableStringHelper $helper, TranslatableStringHelper $helper,
EntityRepository $activityTypeRepository EntityRepository $activityTypeRepository
@ -54,30 +54,30 @@ class TranslatableActivityType extends AbstractType
$this->translatableStringHelper = $helper; $this->translatableStringHelper = $helper;
$this->activityTypeRepository = $activityTypeRepository; $this->activityTypeRepository = $activityTypeRepository;
} }
public function getName() public function getBlockPrefix()
{ {
return 'translatable_activity_type'; return 'translatable_activity_type';
} }
public function getParent() public function getParent()
{ {
return EntityType::class; return EntityType::class;
} }
public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder, array $options) { public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder, array $options) {
/* @var $qb \Doctrine\ORM\QueryBuilder */ /* @var $qb \Doctrine\ORM\QueryBuilder */
$qb = $options['query_builder']; $qb = $options['query_builder'];
if ($options['active_only'] === true) { if ($options['active_only'] === true) {
$qb->where($qb->expr()->eq('at.active', ':active')); $qb->where($qb->expr()->eq('at.active', ':active'));
$qb->setParameter('active', true, \Doctrine\DBAL\Types\Type::BOOLEAN); $qb->setParameter('active', true, \Doctrine\DBAL\Types\Type::BOOLEAN);
} }
} }
public function configureOptions(OptionsResolver $resolver) public function configureOptions(OptionsResolver $resolver)
{ {
$resolver->setDefaults( $resolver->setDefaults(
array( array(
'class' => 'ChillActivityBundle:ActivityType', 'class' => 'ChillActivityBundle:ActivityType',