<?php
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Scripting/PHPClass.php to edit this template
*/
namespace App\FormSubscriber\WorkSheetValue;
use App\Entity\WorksheetValueKlasifikasi;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
/**
* Description of WorkSheetValueKlasifikasiFormSubscriber
*
* @author programmer
*/
class WorkSheetValueKlasifikasiFormSubscriber implements WorkSheetValueFormSubscriberInterface
{
public function isSupported(string $className): bool
{
return WorksheetValueKlasifikasi::class === $className;
}
public static function getSubscribedEvents()
{
return [
FormEvents::POST_SET_DATA => 'postSetData'
];
}
public function postSetData(FormEvent $event):void
{
$event->getForm()
->add('code', TextType::class, [
"label" => "code",
"required" => true
])
->add('description', TextareaType::class, [
"label" => "description",
"required" => false
]);
}
}