Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Not working with Doctrine ODM #487

Closed
cbourgois opened this issue Dec 29, 2014 · 2 comments
Closed

Not working with Doctrine ODM #487

cbourgois opened this issue Dec 29, 2014 · 2 comments

Comments

@cbourgois
Copy link
Contributor

Faker/ORM/Doctrine/EntityPopulator.php use

use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Mapping\ClassMetadata;

which causes errors like this one:

Argument 1 passed to Faker\ORM\Doctrine\EntityPopulator::__construct() must be an instance of Doctrine\ORM\Mapping\ClassMetadata, instance of Doctrine\ODM\MongoDB\Mapping\ClassMetadata given

In the definition of the class, Doctrine\ORM namespace is used, instead of Doctrine\Common if we want to support both ORM and ODM.

if I replace

use Doctrine\ORM\Mapping\ClassMetadata;

by

use Doctrine\Common\Persistence\Mapping\ClassMetadata;

It works a little better, but another error appears :

Fatal error: Call to undefined method Doctrine\ODM\MongoDB\Mapping\ClassMetadata::getAssociationMappings() in .../vendor/fzaninotto/faker/src/Faker/ORM/Doctrine/EntityPopulator.php on line 104

I can make a pull request for fixing this bug, but have not yet a solution for this second error...

@cbourgois
Copy link
Contributor Author

Added pull request #489

@fzaninotto
Copy link
Owner

Fixed by #489

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

No branches or pull requests

2 participants