Marks an annotated instance variable as "persistent". It has to be inside the instance variables PHP DocBlock comment.
Any value hold inside this variable will be saved to and loaded from the database as part of the lifecycle of the instance variables entity-class.
Required attributes:
* type - Name of the Doctrine Type which is converted between PHP and Database representation.
Optional attributes:
* name - By default the property name is used for the database column name also, however the 'name' attribute allows you to determine the column name.
* length - Used by the "string" type to determine its maximum length in the database. Doctrine does not validate the length of a string values for you.
* precision - The precision for a decimal (exact numeric) column (Applies only for decimal column)
* scale - The scale for a decimal (exact numeric) column (Applies only for decimal column)
* unique - Boolean value to determine if the value of the column should be unique accross all rows of the underlying entities table.
* nullable - Determines if NULL values allowed for this column.
* columnDefinition - DDL SQL snippet that starts after the column name and specificies the complete (non-portable!) column definition. This attribute allows to make use of advanced RMDBS features. However you should make careful use of this feature and the consequences. Additionally you should remember that the "type" attribute still handles the conversion between PHP and Database values. If you use this attribute on a column that is used for joins between tables you should also take a look at [@JoinColumn](#ann_joincolumn).
Required annotation to mark a PHP class as Entity. Doctrine manages the persistence of all classes marked as entity.
Optional attributes:
* repositoryClass - Specifies the FQCN of a subclass of the Doctrine\ORM\EntityRepository. Use of repositories for entites is encouraged to keep specialized DQL and SQL operations separated from the Model/Domain Layer.
This annotation is used in the context of relations in [@ManyToOne](#ann_manytoone), [@OneToOne](#ann_onetoone) fields
and in the Context of [@JoinTable](#ann_jointable) nested inside a @ManyToMany. This annotation is not required.
If its not specified the attributes *name* and *referencedColumnName* are infered from the table and primary key names.
Required attributes:
* name - Column name that holds the foreign key identifier for this relation. In the context of @JoinTable it specifies the column name in the join table.
* referencedColumnName - Name of the primary key identifier that is used for joining of this relation.
Optional attributes:
* unique - Determines if this relation exclusive between the affected entities and should be enforced so on the database constraint level. Defaults to false.
* nullable - Determine if the related entity is required, or if null is an allowed state for the relation. Defaults to true.
* onDelete - Cascade Action (Database-level)
* onUpdate - Cascade Action (Database-level)
* columnDefinition - DDL SQL snippet that starts after the column name and specificies the complete (non-portable!) column definition. This attribute allows to make use of advanced RMDBS features. Using this attribute on @JoinColumn is necessary if you need slightly different column definitions for joining columns, for example regarding NULL/NOT NULL defaults. However by default a "columnDefinition" attribute on [@Column](#ann_column) also sets the related @JoinColumn's columnDefinition. This is necessary to make foreign keys work.
Defines an instance variable holds a many-to-many relationship between two entities. [@JoinTable](#ann_jointable)
is an additional, optional annotation that has reasonable default configuration values using the table
and names of the two related entities.
Required attributes:
* targetEntity - FQCN of the referenced target entity. Can be the unqualified class name if both classes are in the same namespace.
Optional attributes:
* mappedBy - This option specifies the property name on the targetEntity that is the owning side of this relation. Its a required attribute for the inverse side of a relationship.
* targetEntity - FQCN of the referenced target entity. Can be the unqualified class name if both classes are in the same namespace.
Optional attributes:
* cascade - Cascade Option
* orphanRemoval - Boolean that specifies if orphans, inverse OneToOne entities that are not connected to any
owning instance, should be removed by Doctrine. Defaults to false.
* mappedBy - This option specifies the property name on the targetEntity that is the owning side of this relation. Its a required attribute for the inverse side of a relationship.
The DQL Snippet in OrderBy is only allowed to consist of unqualified,
unquoted field names and of an optional ASC/DESC positional statement.
Multiple Fields are separated by a comma (,). The referenced field
names have to exist on the `targetEntity` class of the `@ManyToMany` or
`@OneToMany` annotation.
<a name="ann_postload"></a>
+++ @PostLoad
Marks a method on the entity to be called as a @PostLoad event. Only works with @HasLifecycleCallbacks in the entity class PHP DocBlock.
<a name="ann_postpersist"></a>
+++ @PostPersist
Marks a method on the entity to be called as a @PostPersist event. Only works with @HasLifecycleCallbacks in the entity class PHP DocBlock.
<a name="ann_postremove"></a>
+++ @PostRemove
Marks a method on the entity to be called as a @PostRemove event. Only works with @HasLifecycleCallbacks in the entity class PHP DocBlock.
<a name="ann_postupdate"></a>
+++ @PostUpdate
Marks a method on the entity to be called as a @PostUpdate event. Only works with @HasLifecycleCallbacks in the entity class PHP DocBlock.
<a name="ann_prepersist"></a>
+++ @PrePersist
Marks a method on the entity to be called as a @PrePersist event. Only works with @HasLifecycleCallbacks in the entity class PHP DocBlock.
<a name="ann_preremove"></a>
+++ @PreRemove
Marks a method on the entity to be called as a @PreRemove event. Only works with @HasLifecycleCallbacks in the entity class PHP DocBlock.
<a name="ann_preupdate"></a>
+++ @PreUpdate
Marks a method on the entity to be called as a @PreUpdate event. Only works with @HasLifecycleCallbacks in the entity class PHP DocBlock.
<a name="ann_sequencegenerator"></a>
+++ @SequenceGenerator
For the use with @generatedValue(strategy="SEQUENCE") this annotation allows to specifiy details about the sequence,
such as the increment size and initial values of the sequence.
Required attributes:
* sequenceName - Name of the sequence
Optional attributes:
* allocationSize - Increment the sequence by the allocation size when its fetched. A value larger than 1 allows to optimize for scenarios where you create more than one new entity per request. Defaults to 10
* initialValue - Where does the sequence start, defaults to 1.