40 lines
973 B
PHP
40 lines
973 B
PHP
<?php
|
|
|
|
namespace App\Controller\Admin;
|
|
|
|
use App\Entity\Comment;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Field\DateTimeField;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Field\TextEditorField;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
|
|
|
|
/**
|
|
* Class CommentCrudController
|
|
* @package App\Controller\Admin
|
|
*/
|
|
class CommentCrudController extends AbstractCrudController
|
|
{
|
|
public static function getEntityFqcn(): string
|
|
{
|
|
return Comment::class;
|
|
}
|
|
|
|
public function configureFields(string $pageName): iterable
|
|
{
|
|
return [
|
|
AssociationField::new('author')
|
|
->autocomplete(),
|
|
AssociationField::new('blog')
|
|
->autocomplete(),
|
|
TextField::new('title'),
|
|
TextEditorField::new('content'),
|
|
DateTimeField::new('createdAt'),
|
|
AssociationField::new('editedBy')
|
|
->autocomplete(),
|
|
DateTimeField::new('editedAt'),
|
|
|
|
];
|
|
}
|
|
}
|