From 3bd916f763911944e9ddea6995b391fb7e28a907 Mon Sep 17 00:00:00 2001 From: Mauro Pinto Date: Mon, 1 Sep 2014 12:48:10 +0100 Subject: [PATCH] Document embeddables column prefixing --- docs/en/tutorials/embeddables.rst | 96 +++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/docs/en/tutorials/embeddables.rst b/docs/en/tutorials/embeddables.rst index 5ec207fa6..4c95016f6 100644 --- a/docs/en/tutorials/embeddables.rst +++ b/docs/en/tutorials/embeddables.rst @@ -74,6 +74,102 @@ 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 prefixes your columns by using the value object name. + +You can change this behaviour in the following ways: + +.. configuration-block:: + + .. code-block:: php + + + + + + + + + + + + + + + + + + .. code-block:: yaml + + # Default behaviour + # Will name your columns by prefixing them with "address_" + User: + type: entity + embedded: + address: + class: Address + + # Will name your columns by prefixing them with "prefix_" + User: + type: entity + embedded: + address: + class: Address + columnPrefix: prefix_ + + # Will NOT prefix your columns + User: + type: entity + embedded: + address: + class: Address + columnPrefix: false + + +DQL +--- + You can also use mapped fields of embedded classes in DQL queries, just as if they were declared in the ``User`` class: