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

XML mappings should stop extending the Doctrine mapping file #2318

Open
stof opened this issue Nov 17, 2021 · 4 comments
Open

XML mappings should stop extending the Doctrine mapping file #2318

stof opened this issue Nov 17, 2021 · 4 comments
Labels
Still Relevant Mark PRs that might've been auto-closed that are still relevant.

Comments

@stof
Copy link
Contributor

stof commented Nov 17, 2021

Currently, the XML mapping driver relies on adding custom elements inside the Doctrine XML mapping file itself. This relies on the fact that the Doctrine XML schema allows to add any node there. However, this is something that the ORM maintainers want to stop supporting. The 2.10.0 release removed that from the XSD. When I made them aware that gedmo/doctrine-extensions was impacted by that BC break, they agreed on reverting it in 2.10.2. However, I suspect that ORM 3.0 will still perform that BC break again.

It would be wise for gedmo/doctrine-extensions to migrate away from this usage (in a backward-compatible way of course), to avoid being totally blocked by the time ORM 3.0 comes out.

@stof
Copy link
Contributor Author

stof commented Nov 17, 2021

I see 2 solutions there:

  • deprecate support for XML, pushing the extension mapping to be done with annotations all the time (or later PHP attributes once support is added)
  • define a standalone XML mapping format that puts the extension mapping into a dedicated XML file separate from the ORM mapping (no idea about how this file would look like for now)

In any case, there needs to be a way to opt-in for the new driver behavior (as the drivers are currently inferred from the ORM driver being used)

@stof
Copy link
Contributor Author

stof commented Nov 17, 2021

And while this is done, it probably makes sense to do the same for the Yaml driver (but there, as the ORM Yaml driver is deprecated, it might make sense to go for just deprecating the Yaml driver too)

@phansys phansys added the Still Relevant Mark PRs that might've been auto-closed that are still relevant. label Nov 18, 2021
@stof
Copy link
Contributor Author

stof commented Apr 13, 2023

As the ORM has added a flat to turn on XSD validation in their 2.14 release and has deprecated the fact of keeping it disabled, this issue becomes much more relevant, as the current way to put the extension mapping inside the XML file of the ORM mapping would then fail with a XSD validation error.

@eisberg
Copy link

eisberg commented Jun 25, 2024

copy this comment from #2613 (comment)

Many projects use XML for ORM, and there are no plans to translate this into attributes. In the PR (#2657) I proposed, there are two options for setting up Gedmo:

  1. Use separate XML files for Gedmo ( MyEntity.gedmo.xml )
  2. Use attributes, even if the project uses XML (or annotations) for the ORM.
    Without these options, GEDMO takes Doctrine settings, and as a result, it is impossible to use attributes for GEDMO if Doctrine uses xml

Also see PR in bundle: stof/StofDoctrineExtensionsBundle#458

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Still Relevant Mark PRs that might've been auto-closed that are still relevant.
Projects
None yet
Development

No branches or pull requests

3 participants