mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Doctrine ORM documentation example Product entity wrong annotation definition #6227
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @wajdijurry on GitHub (Apr 20, 2019).
Originally assigned to: @lcobucci on GitHub.
Bug Report
Summary
Documentation should be updated, I think it's outdated.
Current behavior
When annotation parser tries to parse the entity annotations, it does not, since the classes (@ORM\Entity), (@ORM\Table), (@ORM\Id), (@ORM\Column) and (@ORM\GeneratedValue) are not defined.
How to reproduce
Follow the steps described in the documentation:
https://www.doctrine-project.org/projects/doctrine-orm/en/latest/tutorials/getting-started.html#what-is-doctrine
vendor/bin/doctrine orm:schema-tool:update --force --dump-sql[OK] No Metadata Classes to process.Expected behavior
Fix
@Entityinstead of@ORM\Entity@AkenRoberts commented on GitHub (Apr 25, 2019):
Hi @wajdijurry. The examples in the docs are accurate. Are you actually receiving an error for
Doctrine\ORM\Annotationclass not existing? Any other specific error, or just the "No Metadata Classes to process." message?Also, where did you put the
bootstrap.phpfile? The docs are vague on that, but it should be at the root of the project.@SenseException commented on GitHub (May 2, 2019):
The Product entity example is using the annotation classes in the 2.6 docs without importing them with
useand an "ORM" alias.Doctrine\ORM\Annotationis a 3.0 namespace and therefore part of the master branch and the 3.0 docs. This is correct.@wajdijurry Do you like to create a PR for the documentation of 2.6.
@wajdijurry commented on GitHub (May 2, 2019):
Yes sure.
@wajdijurry commented on GitHub (May 7, 2019):
Hi @SenseException ,
It seems that the online docs is for doctrine ORM v3.0, but it says to install doctrine ORM v2.6.2, so for which version should I open a new PR ? since it seems that I did not got your last comment :\
@SenseException commented on GitHub (May 8, 2019):
For the 2.6 branch because of the imported annotations.
If there is 2.6 mentioned in the 3.0 docs, this should fixed too in a separate PR.
@wajdijurry commented on GitHub (May 9, 2019):
But the bug is invalid for v2.6, since the annotation class is not imported and it is used without an alias
@SenseException commented on GitHub (May 10, 2019):
Because in the examples of 2.6, the annotation classes, like
@Entityor@Columnaren't imported.@lcobucci commented on GitHub (Sep 12, 2019):
Handled by #7753