Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple Example of Custom Annotations using Symfony2

I am familiar with the Doctrine Documentation about custom annotations, but I am looking for a simple example.

I would like to create an entry in a audit table using an annotation (user, date, action, etc.) when a user creates or updates a widget.

Can you point me to a simple example?

like image 251
Upperstage Avatar asked May 29 '12 20:05

Upperstage


People also ask

Can we create custom annotation in spring boot?

In this way, we can create different custom annotations for validation purposes. You can find the full source code here. It is easy to create and use custom annotations in Java. Java developers will be relieved of redundant code by using custom annotations.

What are annotations in Symfony?

Annotation plays an important role in the configuration of Symfony application. Annotation simplifies the configuration by declaring the configuration in the coding itself. Annotation is nothing but providing meta information about class, methods, and properties.


1 Answers

Here is a good example of using Symfony2 with Doctrine Common in order to create powerful annotations.

like image 154
fsenart Avatar answered Oct 16 '22 00:10

fsenart