diff --git a/docs/en/tutorials/embeddables.rst b/docs/en/tutorials/embeddables.rst index 5ec207fa6..cf13fd56e 100644 --- a/docs/en/tutorials/embeddables.rst +++ b/docs/en/tutorials/embeddables.rst @@ -74,6 +74,77 @@ In terms of your database schema, Doctrine will automatically inline all columns from the ``Address`` class into the table of the ``User`` class, just as if you had declared them directly there. +Column Prefixing +---------------- + +By default, Doctrine names your columns by prefixing them, using the value +object name. + +Following the example above, your columns would be named as ``address_street``, +``address_postalCode``... + +You can change this behaviour to meet your needs by changing the +``columnPrefix`` attribute in the ``@Embeddable`` notation. + +The following example shows you how to set your prefix to ``myPrefix_``: + +.. configuration-block:: + + .. code-block:: php + + + + + + .. code-block:: yaml + + User: + type: entity + embedded: + address: + class: Address + columnPrefix: myPrefix_ + +To have Doctrine drop the prefix and use the value object's property name +directly, set ``columnPrefix=false`` (not yet supported with XML configuration): + +.. configuration-block:: + + .. code-block:: php + +