diff --git a/developer_manual/app/database.rst b/developer_manual/app/database.rst index 06f71bbc2..2580ce68a 100644 --- a/developer_manual/app/database.rst +++ b/developer_manual/app/database.rst @@ -223,6 +223,48 @@ Since all attributes should be protected, getters and setters are automatically $author->setId(3); $author->getPhoneNumber() // null +Custom attribute to database column mapping +------------------------------------------- + +By default each attribute will be mapped to a database column by a certain convention, e.g. **phoneNumber** +will be mapped to the column **phone_number** and vice versa. Sometimes it is needed though to map attributes to +different columns because of backwards compability. To define a custom +mapping, simply override the **columnToProperty** and **propertyToColumn** methods of the entity in question: + +.. code-block:: php + + +