cuexit
cuexit

Reputation: 81

ORM No mapping information to process

Sorry if this is a duplicate question cause I can't seem to find where the problem is in my code.

Once I run the code in the terminal php vendor/bin/doctrine-migrations migrations:diff I get the following error

screenshot of the error

I don't know where this error is coming from.

Update

When i run php vendor/bin/doctrine orm:info i get the following output in terminal

! [CAUTION] You do not have any mapped Doctrine ORM entities according to the current configuration.
! If you have entities or mapping files you should check your mapping configuration for errors.

Cheers!

Upvotes: 4

Views: 5473

Answers (2)

Darius.V
Darius.V

Reputation: 928

For me problem was that I had not added

/**
 * @ORM\Entity()
 */

above entities.

Upvotes: 1

cuexit
cuexit

Reputation: 81

Update

I was missing 2 lines of code in mijn config and those are followed.

$platform = $entityManager->getConnection()->getDatabasePlatform(); $platform->registerDoctrineTypeMapping('enum', 'string');

added these 2 lines and now i don't get any mapping problems.

Ow and used the following link No mapped Doctrine ORM entities according to the current configuration This stack issue will explain what you need to do when you get this problem

UPDATE Found out that i was using @ORM/Entity and when i changed it to @Entity it worked. I went a bit deeper in to this and found out that "useSimpleAnnotationReader" is true so if you put that to false and removed the last 2 rows of code it works perfectly fine. it looks something like this now

$config = Setup::createAnnotationMetadataConfiguration(
$paths,
$isDevMode,
null,
null,
false);

The last one is for "useSimpleAnnotationReader" i put this in the bootstrap.php

Cheers!

Upvotes: 4

Related Questions