Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection Objects for Xml Serialization #124

Closed
beberlei opened this issue Jun 3, 2012 · 3 comments
Closed

Collection Objects for Xml Serialization #124

beberlei opened this issue Jun 3, 2012 · 3 comments

Comments

@beberlei
Copy link

beberlei commented Jun 3, 2012

This expands on GH-117.

I introduced a collection object into my code. The following approaches failed:

  1. ArrayCollection from Doctrine still lead to
  2. A simple Traversable implementation lead to

It seems traversables get special handling in the GraphNavigator#104. I think this should not be the case if the metadata of the traversable is not null.

Additionally to solve the "" problem in xml serialization, there should somehow be a way to at least replace with something, i think the XmlSerializervisitor could use the root element name as entryName of each value somehow in visitArray(). That would even allow serialization of inheritances:

<result><object1/><object2/><object1/><object3/></result>

Ping @lsmith77

@schmittjoh
Copy link
Owner

I agree on not treating Traversables specially. Did you already work on a patch for this?

Regarding the entry name, I'm not sure, it could add some amount of performance penalty since we would have to determine it for each object separately, and then also support the generation in both directions. It gets even more complicated if someone uses the "inline" option in which case we do not even know to which property the entry would belong.

@mvrhov
Copy link
Contributor

mvrhov commented Jun 14, 2012

As I need something like @lsmith pointed out in #48 I've taken a crack at it what seemed to be possible.
Well everything was starting to come together, I implemented a VirtualArrayCollection with a specific interface which would then return a virtual class name, well the problem became when trying to load a metadata for that virtual class. Metadata factory requires a concrete class implementation to be able to load a metadata for.

@schmittjoh
Copy link
Owner

This should now be possible in the same fashion as #117 (see my comments there).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants