Post is a simple class with four properties. The setter for
$id isn't actually generated. Doctrine populates the
$id instance variable directly in the entity hydration phase. We will see later how we delegate the ID generation to the DBMS.
Doctrine annotations are imported from the
\Doctrine\ORM\Mapping namespace with
use statements. They are used in DocBlocks to add mapping information to the class and its properties. DocBlocks are just a special kind of comment starting with
@Entity annotation is used in the class-level DocBlock to specify that this class is an entity class.
The most important attribute of this annotation is
repositoryClass. It allows specifying a custom ...