setEntityLabelInSingular('Conference Comment') ->setEntityLabelInPlural('Conference Comments') ->setSearchFields(['author', 'text', 'email']) ->setDefaultSort(['createdAt' => 'DESC']) ; } public function configureFilters(Filters $filters): Filters { return $filters ->add(EntityFilter::new('conference')); } public function configureFields(string $pageName): iterable { yield AssociationField::new('conference'); yield TextField::new('author'); yield EmailField::new('email'); yield TextareaField::new('text') ->hideOnIndex() ; yield TextField::new('photoFilename') ->onlyOnIndex() ; $createdAt = DateTimeField::new('createdAt')->setFormTypeOptions([ 'years' => range(date('Y'), date('Y') + 5), 'widget' => 'single_text', ]); if(Crud::PAGE_EDIT === $pageName) { yield $createdAt->setFormTypeOption('disabled', true); } } }