Merge branch 'marcu/Chill-CustomFields-master'

Merge request Chill-project/Chill-CustomFields!5

Conflicts:
	Resources/views/Form/fields.html.twig
This commit is contained in:
2015-12-10 15:44:20 +01:00
3 changed files with 14 additions and 50 deletions

View File

@@ -20,14 +20,14 @@
namespace Chill\CustomFieldsBundle\CustomFields;
use Chill\CustomFieldsBundle\Form\Type\ChoicesListType;
use Chill\CustomFieldsBundle\Form\Type\ChoicesType;
use Chill\CustomFieldsBundle\Form\Type\ChoiceWithOtherType;
use Chill\CustomFieldsBundle\CustomFields\CustomFieldInterface;
use Symfony\Component\Form\FormBuilderInterface;
use Chill\CustomFieldsBundle\Entity\CustomField;
use Chill\CustomFieldsBundle\Form\Type\ChoicesType;
use Symfony\Component\HttpFoundation\RequestStack;
use Chill\CustomFieldsBundle\Form\Type\ChoicesListType;
use Chill\CustomFieldsBundle\Form\DataTransformer\CustomFieldDataTransformer;
use Chill\CustomFieldsBundle\Form\Type\ChoiceWithOtherType;
use Symfony\Bridge\Twig\TwigEngine;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Symfony\Component\Translation\Translator;
@@ -122,9 +122,7 @@ class CustomFieldChoice implements CustomFieldInterface
$builder->create($customField->getSlug(), 'choice', $options)
->addModelTransformer(new CustomFieldDataTransformer($this, $customField))
);
}
}
public function buildOptionsForm(FormBuilderInterface $builder)

View File

@@ -13,7 +13,9 @@ interface CustomFieldInterface
{
/**
*
* Return a form type to edit the custom field. This form is shown to the
* user.
*
* @param \Chill\CustomFieldsBundle\CustomField\FormBuilderInterface $builder
* @param \Chill\CustomFieldsBundle\CustomField\CustomField $customField
* @return \Symfony\Component\Form\FormTypeInterface the form type
@@ -21,7 +23,7 @@ interface CustomFieldInterface
public function buildForm(FormBuilderInterface $builder, CustomField $customField);
/**
* transform the value into a format that can be stored in DB
* Transform the value into a format that can be stored in DB
*
* @param mixed $value
* @param \Chill\CustomFieldsBundle\CustomField\CustomField $customField
@@ -38,6 +40,7 @@ interface CustomFieldInterface
public function deserialize($serialized, CustomField $customField);
/**
* Return a repsentation of the value of the CustomField.
*
* @param mixed $value the raw value, **not deserialized** (= as stored in the db)
* @param \Chill\CustomFieldsBundle\CustomField\CustomField $customField
@@ -48,7 +51,7 @@ interface CustomFieldInterface
public function getName();
/**
* return a formType which allow to edit option for the custom type.
* Return a formType which allow to edit option for the custom type.
* This FormType is shown in admin
*
* @param \Chill\CustomFieldsBundle\CustomField\FormBuilderInterface $builder