added option to use only pre-defined tags (#1463)

This commit is contained in:
Kevin Papst
2020-02-12 15:35:42 +01:00
committed by GitHub
parent 847798eec1
commit 1b4f4bba22
16 changed files with 103 additions and 24 deletions

View File

@@ -10,6 +10,7 @@
namespace App\Form\API;
use App\Form\TimesheetEditForm;
use App\Form\Type\TagsInputType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -29,6 +30,19 @@ class TimesheetApiEditForm extends TimesheetEditForm
}
}
/**
* Method added to prevent API BC breaks.
*
* @param FormBuilderInterface $builder
*/
protected function addTags(FormBuilderInterface $builder)
{
$builder
->add('tags', TagsInputType::class, [
'required' => false,
]);
}
public function configureOptions(OptionsResolver $resolver)
{
parent::configureOptions($resolver);