Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions src/Controller/Admin/CommentCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
use App\Entity\Comment;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
use EasyCorp\Bundle\EasyAdminBundle\Field\IdField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextEditorField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextareaField;
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
use EasyCorp\Bundle\EasyAdminBundle\Field\DateTimeField;

class CommentCrudController extends AbstractCrudController
{
Expand All @@ -15,14 +16,17 @@ public static function getEntityFqcn(): string
return Comment::class;
}

/*
public function configureFields(string $pageName): iterable
{
return [
IdField::new('id'),
TextField::new('title'),
TextEditorField::new('description'),
];
yield IdField::new('id')->onlyOnIndex();
yield DateTimeField::new('publishedAt')->onlyOnIndex();
yield TextareaField::new('content')->onlyOnForms();
yield AssociationField::new('author')
->setSortProperty('fullName')
->onlyOnForms();
yield AssociationField::new('post')
->setSortProperty('title')
->onlyOnForms();
yield DateTimeField::new('publishedAt')->onlyOnForms();
}
*/
}
5 changes: 5 additions & 0 deletions src/Entity/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ public function __construct()
$this->tags = new ArrayCollection();
}

public function __toString(): string
{
return $this->getTitle();
}

public function getId(): ?int
{
return $this->id;
Expand Down