I have two entities, Offer and Candidate, with a OneToMany relationship between them. The relevant code parts are the followings:
In Offer.php:
/**
* @ORM\OneToMany(targetEntity=Candidate::class, mappedBy="offer", orphanRemoval=true)
*/
private $candidates;
public function __construct()
{
$this->candidates = new ArrayCollection();
}
In Candidate.php:
/**
* @ORM\ManyToOne(targetEntity=Offer::class, inversedBy="candidates")
* @ORM\JoinColumn(nullable=false)
*/
private $offer;
In OfferCrudController.php:
public function configureFields(string $pageName): iterable
{
return [
ArrayField::new('candidates', new TranslatableMessage('easyadmin.candidates'))
->onlyOnDetail(),
AssociationField::new('candidates', new TranslatableMessage('easyadmin.candidates'))
->onlyOnIndex()
];
}
In CandidateCrudController.php:
public function configureFields(string $pageName): iterable
{
return [
AssociationField::new('offer', new TranslatableMessage('easyadmin.candidate.offer'))
];
}
My problem is that while in the case of Candidates EasyAdmin displays the Offer linked to its details page for each Candidate, for the Offers it displays only the non-clickable string representations of the Candidates, as the images show it:
Is it possible to display the Candidates too with their appropriate links to their details page?