Search code examples
symfonysonata-admin

How to change entity name in flash message


After editing an object I got this flash message

L'élément "P\BOBundle\Entity\Distributeur:0000000037396bc6000000006e8ad34e" a été mis à jour avec succès.

So I need to change the entity name in this message: P\BOBundle\Entity\Distributeur:0000000037396bc6000000006e8ad34e to Distributeur.


Solution

  • the best solution is to override

    __toString

    methode in the entity class and make it return the name of object.