1
0
mirror of synced 2024-12-14 07:06:04 +03:00

[DDC-692] Add docs on 2.1 read only entities feature

This commit is contained in:
Benjamin Eberlei 2011-03-29 20:30:10 +02:00
parent 22ab3d1256
commit abc8f29800
3 changed files with 18 additions and 3 deletions

View File

@ -202,6 +202,9 @@ Optional attributes:
Doctrine. Use of repositories for entities is encouraged to keep
specialized DQL and SQL operations separated from the Model/Domain
Layer.
- **readOnly**: (>= 2.1) Specifies that this entity is marked as read only and not
considered for change-tracking. Entities of this type can be persisted
and removed though.
Example:

View File

@ -33,6 +33,15 @@ Make effective use of the available alternative query result
formats like nested array graphs or pure scalar results, especially
in scenarios where data is loaded for read-only purposes.
Read-Only Entities
------------------
Starting with Doctrine 2.1 you can mark entities as read only (See metadata mapping
references for details). This means that the entity marked as read only is never considered
for updates, which means when you call flush on the EntityManager these entities are skipped
even if properties changed. Read-Only allows to persist new entities of a kind and remove existing
ones, they are just not considered for updates.
Apply Best Practices
--------------------

View File

@ -170,14 +170,17 @@ Required attributes:
Optional attributes:
- table - The Table-Name to be used for this entity. Otherwise the
- **table** - The Table-Name to be used for this entity. Otherwise the
Unqualified Class-Name is used by default.
- repository-class - The fully qualified class-name of an
- **repository-class** - The fully qualified class-name of an
alternative ``Doctrine\ORM\EntityRepository`` implementation to be
used with this entity.
- inheritance-type - The type of inheritance, defaults to none. A
- **inheritance-type** - The type of inheritance, defaults to none. A
more detailed description follows in the
*Defining Inheritance Mappings* section.
- **read-only** - (>= 2.1) Specifies that this entity is marked as read only and not
considered for change-tracking. Entities of this type can be persisted
and removed though.
Defining Fields
~~~~~~~~~~~~~~~