mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-14 06:14:23 +00:00
fix deprecations: use fqcn and other deprecated properties
This commit is contained in:
parent
8c97ac9e26
commit
c8f53e6472
@ -373,8 +373,8 @@ class CustomFieldsGroupController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$form = $this->createForm(FormTypeCustomField::class, null, array('group' => $entity));
|
$form = $this->createForm(FormTypeCustomField::class, null, array('group' => $entity));
|
||||||
$form->add('submit_dump', 'submit', array('label' => 'POST AND DUMP'));
|
$form->add('submit_dump', SubmitType::class, array('label' => 'POST AND DUMP'));
|
||||||
$form->add('submit_render','submit', array('label' => 'POST AND RENDER'));
|
$form->add('submit_render', SubmitType::class, array('label' => 'POST AND RENDER'));
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
$this->get('twig.loader')
|
$this->get('twig.loader')
|
||||||
|
@ -22,13 +22,17 @@
|
|||||||
|
|
||||||
namespace Chill\CustomFieldsBundle\CustomFields;
|
namespace Chill\CustomFieldsBundle\CustomFields;
|
||||||
|
|
||||||
use Chill\CustomFieldsBundle\CustomFields\CustomFieldInterface;
|
|
||||||
use Chill\CustomFieldsBundle\Entity\CustomField;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\Validator\Constraints\GreaterThanOrEqual;
|
use Symfony\Component\Validator\Constraints\GreaterThanOrEqual;
|
||||||
use Symfony\Component\Validator\Constraints\LessThanOrEqual;
|
use Symfony\Component\Validator\Constraints\LessThanOrEqual;
|
||||||
use Symfony\Component\HttpFoundation\RequestStack;
|
use Symfony\Component\HttpFoundation\RequestStack;
|
||||||
use Symfony\Bundle\TwigBundle\TwigEngine;
|
use Symfony\Bundle\TwigBundle\TwigEngine;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
|
|
||||||
|
use Chill\CustomFieldsBundle\CustomFields\CustomFieldInterface;
|
||||||
|
use Chill\CustomFieldsBundle\Entity\CustomField;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -73,6 +77,7 @@ class CustomFieldNumber extends AbstractCustomField
|
|||||||
|
|
||||||
//select the type depending to the SCALE
|
//select the type depending to the SCALE
|
||||||
$type = ($options[self::SCALE] === 0 or $options[self::SCALE] === NULL)?
|
$type = ($options[self::SCALE] === 0 or $options[self::SCALE] === NULL)?
|
||||||
|
//IntegerType::class : NumberType::class;
|
||||||
'integer' : 'number';
|
'integer' : 'number';
|
||||||
|
|
||||||
$fieldOptions = $this->prepareFieldOptions($customField, $type);
|
$fieldOptions = $this->prepareFieldOptions($customField, $type);
|
||||||
@ -125,24 +130,24 @@ class CustomFieldNumber extends AbstractCustomField
|
|||||||
public function buildOptionsForm(FormBuilderInterface $builder)
|
public function buildOptionsForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
return $builder
|
return $builder
|
||||||
->add(self::MIN, 'number', array(
|
->add(self::MIN, NumberType::class, array(
|
||||||
'scale' => 2,
|
'scale' => 2,
|
||||||
'label' => 'Greater or equal than',
|
'label' => 'Greater or equal than',
|
||||||
'required' => false
|
'required' => false
|
||||||
))
|
))
|
||||||
->add(self::MAX, 'number', array(
|
->add(self::MAX, NumberType::class, array(
|
||||||
'scale' => 2,
|
'scale' => 2,
|
||||||
'label' => 'Lesser or equal than',
|
'label' => 'Lesser or equal than',
|
||||||
'required' => false
|
'required' => false
|
||||||
))
|
))
|
||||||
->add(self::SCALE, 'integer', array(
|
->add(self::SCALE, IntegerType::class, array(
|
||||||
'scale' => 0,
|
'scale' => 0,
|
||||||
'label' => 'Precision',
|
'label' => 'Precision',
|
||||||
'constraints' => array(
|
'constraints' => array(
|
||||||
new GreaterThanOrEqual(array('value' => 0))
|
new GreaterThanOrEqual(array('value' => 0))
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
->add(self::POST_TEXT, 'text', array(
|
->add(self::POST_TEXT, TextType::class, array(
|
||||||
'label' => 'Text after the field'
|
'label' => 'Text after the field'
|
||||||
))
|
))
|
||||||
;
|
;
|
||||||
|
@ -28,6 +28,7 @@ class PostTextNumberExtension extends PostTextExtension
|
|||||||
{
|
{
|
||||||
public function getExtendedType()
|
public function getExtendedType()
|
||||||
{
|
{
|
||||||
|
//return PostTextNumberExtension::class;
|
||||||
return 'number';
|
return 'number';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ class CustomFieldType extends AbstractType
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBlockPrefix()
|
public function getName()
|
||||||
{
|
{
|
||||||
return 'custom_field';
|
return 'custom_field';
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ class LinkedCustomFieldsType extends AbstractType
|
|||||||
|
|
||||||
public function getParent()
|
public function getParent()
|
||||||
{
|
{
|
||||||
return 'choice';
|
return ChoiceType::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user