Skip to content

Update docs for latest Doctrine removals #9401

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

Closed
5 of 8 tasks
javiereguiluz opened this issue Mar 6, 2018 · 7 comments
Closed
5 of 8 tasks

Update docs for latest Doctrine removals #9401

javiereguiluz opened this issue Mar 6, 2018 · 7 comments
Labels

Comments

@javiereguiluz
Copy link
Member

javiereguiluz commented Mar 6, 2018

Latest Doctrine versions are removing features that we use on Symfony Docs. We should double check everything, remove no longer relevant docs and provide alternatives when possible:

Changes already included in Doctrine 2.x

(we can already make these changes in Symfony Docs)

  • Removed support for entity namespace aliases: App:User no longer works, use User::class or App\Entity\User: doctrine/orm@63cb801
  • Removed support for same-namespace class resolution. Now you must use ::class in annotations: doctrine/orm@cd590f2
    /**
    -    @ORM\ManyToOne(targetEntity="NotifyChangedEntity", inversedBy="items") */
    +    @ORM\ManyToOne(targetEntity=NotifyChangedEntity::class, inversedBy="items") 
    */
  • Removed support for named queries: doctrine/orm@e6557cb
  • Removed EntityManager::copy: doctrine/orm@c4eb2b0
  • Removed reverse engineering (convert:mapping) and entity generation (generate:entity): doctrine/orm@e4ce75a

Changes planned for the upcoming Doctrine 3.x

(please don't make any of these changes until Doctrine 3 is released)

  • Removed the YAML metadata driver: you can no longer define the entity using YAML. Only XML and annotations. doctrine/orm@bc0c098
  • Removed EntityManager::detach: doctrine/orm@df397e1
  • Removed PDO dependency: the support of PDO::PARAM_*, PDO::FETCH_*, PDO::CASE_* and PDO::PARAM_INPUT_OUTPUT constants in the DBAL API is removed. \Doctrine\DBAL\Driver\PDOStatement does not extend \PDOStatement anymore: Remove hard dependency on PDO doctrine/dbal#2958
@flip111
Copy link
Contributor

flip111 commented Mar 6, 2018

Some explanation about the entity code generator removal can be found here doctrine/orm#6418

@stof
Copy link
Member

stof commented Mar 6, 2018

Part of these updates can be done already (for instance, using ::class in annotation works in Doctrine 2.x already). But some of these are related to BC breaks in the future Doctrine 3, which has no ETA yet (and so working on the update right now is not worth it)

@stof
Copy link
Member

stof commented Mar 7, 2018

btw, I'm quite sure some of these changes won't impact the Symfony doc:

  • EntityManager::copy was never implemented in Doctrine, so it is probably not documented anywhere in Symfony (and should be removed immediately if it is)
  • named queries are a very advanced feature of Doctrine (for which I never found a use case btw), and I don't think we document it either.

@javiereguiluz
Copy link
Member Author

@stof thanks for the details. I've updated the description to separate the issues between "doable now" and "wait for Doctrine 3". If there's any error, please edit the description. Thanks!

@stof
Copy link
Member

stof commented Mar 8, 2018

EntityManager::copy is doable now. It is removed from 3.x, but it never worked in 2.x (see the removed implementation: throw new \BadMethodCallException("Not implemented.");). But I don't think we have any doc using it, because of that (so probably nothing to do).

regarding the mapping conversion and the entity generation, I think we should already work today on removing them from the Symfony documentation. The Doctrine team discourages their usage since years, so we should not push for it.

javiereguiluz added a commit that referenced this issue Nov 27, 2018
This PR was submitted for the master branch but it was merged into the 2.8 branch instead (closes #10696).

Discussion
----------

change targetEntity format

According to #9401 improved support for entity namespace aliases

Commits
-------

1633ff0 change targetEntity format
@javiereguiluz
Copy link
Member Author

Here's a list of everything removed in DBAL 3.0: doctrine/dbal#3518

@javiereguiluz
Copy link
Member Author

I'm closing this one as fixed because I've verified that we no longer use features removed in 2.x. For the future 3.x, we'll take care of that when it's released. Thanks!

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

No branches or pull requests

3 participants