public function testFieldTypeYieldsChoices() { $this->assertInternalType('array', FieldTypes::getChoices()); }
/** * Exception constructor. * * @param string $fieldType */ public function __construct($fieldType) { $choices = array_keys(FieldTypes::getChoices()); $this->message = sprintf('Accard field type must be one of [%s], got "%s".', implode(', ', $choices), $fieldType); }
/** * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('name', 'text', array('label' => 'dag.field.form.name'))->add('presentation', 'text', array('label' => 'dag.field.form.presentation'))->add('type', 'choice', array('label' => 'dag.field.form.type', 'choices' => FieldTypes::getChoices()))->add('option', 'dag_option_choice', array('label' => 'dag.field.form.option', 'required' => false))->add('allowMultiple', 'checkbox', array('label' => 'dag.field.form.allow_multiple', 'required' => false))->add('addable', 'checkbox', array('label' => 'dag.field.form.addable', 'required' => false))->add('order', 'dag_option_order_choice', array('required' => true)); }