Now i have a lot of entities with:
#[ORM\Column(type: 'datetime')]
#[Groups(['article_category:output'])]
/**
* @Timestampable(on="create")
*/
private \DateTime $createdAt;
public function getCreatedAt(): \DateTime
{
return $this->createdAt;
}
And i want to put it inside Trait. But each entity has its own normalization group (like 'article_category:output'). How can I make this field always available from the API Platform?
What we did:
use a group in your trait, e.g.
timestampableThen whenever you want to expose the timestamps, add them to your config (you can add multiple groups to an operation)