Referencing self:: constants in annotations
At the moment constant parsing doesn't read self:: constants and I have a use case where that would be the most practical solution:
I would like to pass serialization groups for a property that's defined in a trait. Since not all entities will have the same serialization groups for the properties in the traits, the only currently available options that I see is to either repeat the property definition in each entity or repeat the groups serialization definition for each property and each entity in yaml/xml.
I would have created a PR instead of an issue for this, but from what I see in the DocParser class, the only way to get the original class name would be to parse the context string, which seems like a bad idea. I'm hoping that someone more familiar with the codebase could do it in a cleaner way. If there isn't a better way, please let me know and I'll make a PR.
I think this most likely will have to wait for Annotations 2.0. Unfortunately the timeline for 2.0 is not solidified.
With @Majkl578 no longer working on 2.0, I don't think waiting for 2.0 to add new non BC breaking features makes sense. I don't mind doing the work, I just need a nudge in the right direction, if there is one. If not, I can add this feature the ugly way and it can be re-implemented properly in 2.0.
@alcaeus it looks like you took over the project, can you please weigh in on this issue?
At the moment constant parsing doesn't read
self::constants and I have a use case where that would be the most practical solution: I would like to pass serialization groups for a property that's defined in a trait. Since not all entities will have the same serialization groups for the properties in the traits, the only currently available options that I see is to either repeat the property definition in each entity or repeat the groups serialization definition for each property and each entity in yaml/xml.I would have created a PR instead of an issue for this, but from what I see in the DocParser class, the only way to get the original class name would be to parse the context string, which seems like a bad idea. I'm hoping that someone more familiar with the codebase could do it in a cleaner way. If there isn't a better way, please let me know and I'll make a PR.
+1 : this modification would be really great! The "static::" keyword too.
This has been released in 1.11.0, right?