Skip to content

Commit d8212d8

Browse files
committed
[cookbook][doctrine] Updated for MongoDB changes
1 parent d80d7e5 commit d8212d8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cookbook/doctrine/mongodb.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ yaml.
8585
8686
.. code-block:: yaml
8787
88-
# Acme/HelloBundle/Resources/config/doctrine/metadata/mongodb/Acme.HelloBundle.Document.User.dcm.yml
88+
# Acme/HelloBundle/Resources/config/doctrine/Acme.HelloBundle.Document.User.mongodb.yml
8989
Acme\HelloBundle\Document\User:
9090
type: document
9191
collection: user
@@ -98,7 +98,7 @@ yaml.
9898
9999
.. code-block:: xml
100100
101-
<!-- Acme/HelloBundle/Resources/config/doctrine/metadata/mongodb/Acme.HelloBundle.Document.User.dcm.xml -->
101+
<!-- Acme/HelloBundle/Resources/config/doctrine/Acme.HelloBundle.Document.User.mongodb.xml -->
102102
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
103103
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
104104
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
@@ -154,7 +154,7 @@ Now, use your document and manage its persistent state with Doctrine:
154154
155155
public function deleteAction($id)
156156
{
157-
$dm = $this->get('doctrine.odm.entity_manager');
157+
$dm = $this->get('doctrine.odm.mongodb.document_manager');
158158
$user = $dm->createQuery('find all from AcmeHelloBundle:User where id = ?', $id);
159159
$dm->remove($user);
160160
$dm->flush();
@@ -271,13 +271,13 @@ can control. The following configuration options exist for a mapping:
271271
To avoid having to configure lots of information for your mappings you should
272272
follow these conventions:
273273

274-
1. Put all your entities in a directory ``Document/`` inside your bundle. For
274+
1. Put all your documents in a directory ``Document/`` inside your bundle. For
275275
example ``Acme/HelloBundle/Document/``.
276276
2. If you are using xml, yml or php mapping put all your configuration files
277-
into the ``Resources/config/doctrine/metadata/doctrine/mongodb/`` directory
278-
suffixed with dcm.xml, dcm.yml or dcm.php respectively.
277+
into the ``Resources/config/doctrine/`` directory
278+
suffixed with mongodb.xml, mongodb.yml or mongodb.php respectively.
279279
3. Annotations is assumed if an ``Document/`` but no
280-
``Resources/config/doctrine/metadata/mongodb/`` directory is found.
280+
``Resources/config/doctrine/`` directory is found.
281281

282282
The following configuration shows a bunch of mapping examples:
283283

0 commit comments

Comments
 (0)