-3

I want to use a field in an entity that is linked in another entity that I use in my controller. I use easyadmin 3 and symfony 4. How to make an AssociationField in this condition? Can someone give me a hand? thanks

Example: In a "payment" table, there is a "debt_id" field (related to the payment table). And in the "debt" table, I want to select another field (for example, the paid field).

Ravo
  • 1
  • 2

1 Answers1

0

Let's say that you added in your payment CrudController a field like that:

AssociationField::new('debt_id'),

So now you should add this code in your Debt Entity:

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