Symfony mapped entities error while generating getters and setters

→ Are you a new visitor? Please visit the page guidance for new visitors ←

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:

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:

and NOT:

Request an article ←