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

Doctrine ORM 3 support #6199

Closed
stevan-tosic opened this issue Feb 9, 2024 · 3 comments
Closed

Doctrine ORM 3 support #6199

stevan-tosic opened this issue Feb 9, 2024 · 3 comments

Comments

@stevan-tosic
Copy link

API Platform version(s) affected: 3.1.16

Description
The doctrine/orm package version v3.* introduces breaking changes.

How to reproduce

  1. Update the doctrine/orm package to version 3.*.
  2. Attempt to execute a GET method on a resource that has a OneToMany relation.

Possible Solution
Set an upper version limit for the doctrine/orm package in composer.lock to v2.18.

Additional Context
This issue affects all versions which contain the require block "doctrine/orm": "^2.14" in composer.lock.

@vaybay
Copy link

vaybay commented Feb 13, 2024

Hello, same problem, downgrade doctrine/orm to 2.18 and it's work !

@ZaneCEO
Copy link

ZaneCEO commented Feb 17, 2024

I was bitten by this trying to disable the autoincrement on my entities during an import from another system. This is the code to reproduce the problem:

use Doctrine\ORM\Mapping\ClassMetadata;

            $this->entityManager
                ->getClassMetadata('myClass')
                ->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE);

The same code, working perfectly with with 2.x, was:

use Doctrine\ORM\Mapping\ClassMetadataInfo;

            $this->entityManager
                ->getClassMetadata('myClass')
                ->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_NONE);

@soyuka
Copy link
Member

soyuka commented Mar 5, 2024

#6193

@soyuka soyuka transferred this issue from api-platform/api-platform Mar 5, 2024
@soyuka soyuka changed the title Attempted to load class \"ClassMetadataInfo\" from namespace \"Doctrine\\ORM\\Mapping\".\nDid you forget a \"use\" statement for another namespace? Doctrine ORM 3 support Mar 5, 2024
@soyuka soyuka closed this as completed Mar 5, 2024
@soyuka soyuka pinned this issue Mar 5, 2024
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

Successfully merging a pull request may close this issue.

4 participants