Discussion:
[doctrine-user] Are lifecycle callbacks supported by Embeddables?
Holtkamp
2016-07-05 08:39:21 UTC
Permalink
I am trying to have a "postLoad" callback invoked on an Embeddable in order
to load a Currency Entity based on its identifying code (for example
'EUR').

When the method is not available in the Embeddable, an exception is thrown:

"Message: Entity 'Project\Domain\ValueObject\Money' has no method
'initializeCurrency' to be registered as lifecycle callback."

Ok:
- it seems the configuration is respected.
- the exception message does "think" we are dealing with an Entity...
- when the 'initializeCurrency()' is added to
Project\Domain\ValueObject\Money, it seems never invoked...

Bottomline, are lifecycle callbacks supported for Embeddables?

Cheers
--
You received this message because you are subscribed to the Google Groups "doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to doctrine-user+***@googlegroups.com.
To post to this group, send email to doctrine-***@googlegroups.com.
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
Holtkamp
2017-11-28 17:22:29 UTC
Permalink
Answered here: https://github.com/doctrine/doctrine2/issues/6855
Post by Holtkamp
I am trying to have a "postLoad" callback invoked on an Embeddable in
order to load a Currency Entity based on its identifying code (for example
'EUR').
"Message: Entity 'Project\Domain\ValueObject\Money' has no method
'initializeCurrency' to be registered as lifecycle callback."
- it seems the configuration is respected.
- the exception message does "think" we are dealing with an Entity...
- when the 'initializeCurrency()' is added to
Project\Domain\ValueObject\Money, it seems never invoked...
Bottomline, are lifecycle callbacks supported for Embeddables?
Cheers
--
You received this message because you are subscribed to the Google Groups "doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to doctrine-user+***@googlegroups.com.
To post to this group, send email to doctrine-***@googlegroups.com.
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.
Loading...