deblan.io-murph/core/Form/FileManager/FileInformationType.php

35 lines
928 B
PHP

<?php
namespace App\Core\Form\FileManager;
use App\Core\Entity\FileInformation;
use App\Core\Form\Type\CollectionType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class FileInformationType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add(
'attributes',
CollectionType::class,
[
'entry_type' => FileInformationAttributeType::class,
'by_reference' => false,
'allow_add' => true,
'allow_delete' => true,
'prototype' => true,
]
);
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => FileInformation::class,
]);
}
}