Category : entity-groups

I am trying to serialise data as JSON with the default Symfony Serializer. To do that I’m trying to use @Groups() as explained here: https://symfony.com/doc/current/serializer.html After adding the @Groups annotation as shown below: class User implements UserInterface { // … /** * @ORMOneToMany(targetEntity=PortfolioItem::class, mappedBy="user", orphanRemoval=true) * @ORMOrderBy({"id" = "DESC"}) * @Groups({"show_user"}) */ private $portfolioItems; } ..

Read more