<?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\WorkSheet;
use App\Entity\WorksheetKlasifikasi;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
/**
* Description of KlasifikasiWorkSheetFormSubscriber
*
* @author programmer
*/
class KlasifikasiWorkSheetFormSubscriber implements WorkSheetFormSubscriberInterface
{
//put your code here
public function isSupported(string $className): bool
{
return WorksheetKlasifikasi::class === $className;
}
public static function getSubscribedEvents()
{
return [
FormEvents::POST_SET_DATA => 'postSetData'
];
}
public function postSetData(FormEvent $event):void
{
$event->getForm()
->add('klasifikasi', EntityType::class, [
"label" => "klasifikasi",
"class" => \App\Entity\Klasifikasi::class
]);
}
}