/**
  * 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);
 }
예제 #2
0
 /**
  * {@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));
 }
예제 #3
0
 public function testFieldTypeTieldsChoiceKeys()
 {
     $this->assertInternalType('array', FieldTypes::getKeys());
 }
예제 #4
0
 public static function getKeys()
 {
     return FieldTypes::getKeys();
 }