Generating getters and setters
Doctrine command-line tools that we configured in Chapter 1, Getting Started with Doctrine 2, include a useful command that generates getter and setter methods of an Entity class for us. We will use it to save us from having to write those of the Post
class.
Run the following command to generate getters and setters of all entity classes of the application:
php vendor/bin/doctrine.php orm:generate:entities src/
Note
If you have several entities and don't want to generate getters and setters for all of them, use the filter
option with the orm:generate:entities
command.