Symfony mapped entities error while generating getters and setters
Symfony mapped entities error while generating getters and setters
If you ever used Symfony php framework, and you wanted to generate through command line the setters and getters for your entity after you defined everything in your entities files, and you got an error like this:
1 |
Namespace "Apn\ApnBundle\Entity\Users.php" does not contain any mapped entities. |
you probably want to know the solution of that also, am I right ?
Solution
“php app/console doctrine:generate:entities” command does not take file extensions, it takes actually namespaces, so just by removing the .php extension (I assume that you wrote good the entity definitions in /Entity/Users.php) it should work.
So, do it like this:
1 |
php app/console doctrine:generate:entities Apn/ApnBundle/Entity/Users |
and NOT:
1 |
php app/console doctrine:generate:entities Apn/ApnBundle/Entity/Users.php |