Question

I got a problem with doctrine orm using annotation driver releated to the lifecyclecallback. I got 2 classes:

  1. abstract Model (marked as MappedSuperclass, haslifecyclecallbacks)
  2. User (extending Model, marked as entity)

the prePresist method isn't called if i save an instance of user to the database. If i move the method to the User class everything works fine.

Can you give me a hint how to get the inheritance to work like expected? (i try to set an uuid instead of an id for all classes extending the Model class)

You can watch it at this gist

Was it helpful?

Solution

Usage of lifecycle callbacks this way is not supported by the annotation metadata driver. Consider using either the YAML or XML mappers instead, since they allow such kind of usage. You will still have to tell the driver that each of your subclasses has some lifecycle callbacks.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top