From efb52bcd6f27ca681b13c07c2d9c756e69f999fa Mon Sep 17 00:00:00 2001 From: Toby Griffiths Date: Thu, 27 Oct 2016 13:00:15 +0100 Subject: [PATCH 1/2] Added note on ODM id notation being different As the ODM YML notation for the `id` field is different, I've added a note, as I spent ages wondering why it wasn't working for me. --- doctrine.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doctrine.rst b/doctrine.rst index 1cae85efb4f..5c27f61c209 100644 --- a/doctrine.rst +++ b/doctrine.rst @@ -382,6 +382,11 @@ directly inside the ``Product`` class via DocBlock annotations: not possible to mix YAML metadata definitions with annotated PHP entity class definitions. +.. note:: + + If using the Doctrine ODM the mapping of the `id` field is slightly different. You should define the field as normal, under the `fields` key, and add `id: true` to the definition. See the `Doctrine MongoDB YAML Driver documentation `_ for more info. + Using the above format will result in the error "No identifier/primary key specified for Document ''. Every Document must have an identifier/primary key.". + .. tip:: The table name is optional and if omitted, will be determined automatically From 9895252045323a6631fe1a066dbcb647e2a77d5e Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 3 Nov 2016 16:48:46 +0100 Subject: [PATCH 2/2] Removed the proposed note and updated the title --- doctrine.rst | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/doctrine.rst b/doctrine.rst index 5c27f61c209..c65a9f67c22 100644 --- a/doctrine.rst +++ b/doctrine.rst @@ -1,8 +1,8 @@ .. index:: single: Doctrine -Databases and Doctrine -====================== +Databases and the Doctrine ORM +============================== One of the most common and challenging tasks for any application involves persisting and reading information to and from a database. Although @@ -382,11 +382,6 @@ directly inside the ``Product`` class via DocBlock annotations: not possible to mix YAML metadata definitions with annotated PHP entity class definitions. -.. note:: - - If using the Doctrine ODM the mapping of the `id` field is slightly different. You should define the field as normal, under the `fields` key, and add `id: true` to the definition. See the `Doctrine MongoDB YAML Driver documentation `_ for more info. - Using the above format will result in the error "No identifier/primary key specified for Document ''. Every Document must have an identifier/primary key.". - .. tip:: The table name is optional and if omitted, will be determined automatically