Skip to content

Commit

Permalink
Generated/Virtual Columns: Insertable / Updateable
Browse files Browse the repository at this point in the history
Added documentation.
doctrine#5728
  • Loading branch information
mehldau committed Oct 19, 2021
1 parent 384159a commit 22e7692
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/en/reference/annotations-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ Optional attributes:

- **nullable**: Determines if NULL values allowed for this column. If not specified, default value is false.

- **insertable**: Boolean value to determine if the column should be
included when inserting a new row into the underlying entities table. If not specified, default value is true.

- **updateable**: Boolean value to determine if the column should be
included when updating the row of the underlying entities table. If not specified, default value is true.

- **options**: Array of additional options:

- ``default``: The default value to set for the column if no value
Expand Down Expand Up @@ -193,6 +199,12 @@ Examples:
*/
protected $loginCount;
/**
* Generated column
* @Column(type="string", name="user_fullname", insertable=false, updateable=false)
*/
protected $fullname;
.. _annref_column_result:

@ColumnResult
Expand Down
8 changes: 8 additions & 0 deletions docs/en/reference/attributes-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ Optional attributes:
- **nullable**: Determines if NULL values allowed for this column.
If not specified, default value is ``false``.

- **insertable**: Boolean value to determine if the column should be
included when inserting a new row into the underlying entities table
If not specified, default value is ``true``.

- **updateable**: Boolean value to determine if the column should be
included when updating the row of the underlying entities table.
If not specified, default value is ``true``.

- **options**: Array of additional options:

- ``default``: The default value to set for the column if no value
Expand Down
4 changes: 4 additions & 0 deletions docs/en/reference/basic-mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ list:
unique key.
- ``nullable``: (optional, default FALSE) Whether the database
column is nullable.
- ``insertable``: (optional, default TRUE) Whether the database
column should be inserted.
- ``updateable``: (optional, default TRUE) Whether the database
column should be updated.
- ``precision``: (optional, default 0) The precision for a decimal
(exact numeric) column (applies only for decimal column),
which is the maximum number of digits that are stored for the values.
Expand Down
2 changes: 2 additions & 0 deletions docs/en/reference/xml-mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ Optional attributes:
table? Defaults to false.
- nullable - Should this field allow NULL as a value? Defaults to
false.
- insertable - Should this field be inserted? Defaults to true.
- updateable - Should this field be updated? Defaults to true.
- version - Should this field be used for optimistic locking? Only
works on fields with type integer or datetime.
- scale - Scale of a decimal type.
Expand Down

0 comments on commit 22e7692

Please sign in to comment.