Closed renoirb closed 1 year ago
+1
If you followed the tutorial http://jmsyst.com/bundles/JMSAopBundle#transaction-management, it should work without any problems. Where did you stuck?
By the way. This Transaction Managment Annotation doesnt work with OAuthv2-php. But its propobly mater of Annotation Reader
I think part of the confusion is over how the @DI... tags are working, plus how annotations work in general.
To do something similar I had to create a separate Annotation class (annotated with @Annotation - see https://techpunch.co.uk/development/custom-annotations-in-symfony2-using-doctrine2s-annotation-classes except make the @Target point to "METHOD"), and then in the methodMatches look for that class with a full class name -
Example:
return null !== $this->read->getMethodAnnotation($method,'SomethingBundle\Annotation\MyAnnotation');
Then I dropped in the services into service.yml as in the first examples and it seems to work.
I am trying to use as the documentation explain and set in an entity a transaction using the @Transactional annotation.
But I cannot see how to make it work.
I am fairly new to Symfony2 and Dependency Injection and the bundle seem very powerful, but I cannot find a way around to actually use the transaction pointcut/interceptor into the project.