Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 8a6c883

Browse files
committed
Merge pull request #472 from symfony-cmf/odm-doc
cleaning up the odm documentation
2 parents 2fc55bb + e9a920f commit 8a6c883

29 files changed

+2629
-2402
lines changed

book/database_layer.rst

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ In this chapter, you will learn how to work with the Doctrine PHPCR-ODM.
1414
Read more about choosing the correct storage layer in
1515
:doc:`../cookbook/database/choosing_storage_layer`
1616

17+
.. note::
18+
19+
This chapter assumes you are using a Symfony setup with PHPCR-ODM already
20+
set up, like the :doc:`CMF Standard Edition <installation>` or the
21+
:doc:`CMF sandbox <../cookbook/editions/cmf_sandbox>`. See
22+
:doc:`../bundles/phpcr_odm/introduction` for how to set up PHPCR-ODM in
23+
your applications.
24+
1725
PHPCR: A Tree Structure
1826
-----------------------
1927

@@ -34,10 +42,9 @@ Multilanguage support.
3442
.. sidebar:: PHPCR Implementations
3543

3644
In order to let the Doctrine PHPCR-ODM communicate with the PHPCR, a PHPCR
37-
implementation is needed. `Jackalope`_ is the reference PHPCR implementation,
38-
which can work with `Apache Jackrabbit`_ (with the `jackalope-jackrabbit`_
39-
package) and with Doctrine DBAL (providing support for postgres, sqlite
40-
and mysql) with the `jackalope-doctrine-dbal`_ package.
45+
implementation is needed. See
46+
":doc:`../cookbook/database/choosing_phpcr_implementation`" for an overview
47+
of the available implementations.
4148

4249
A Simple Example: A Task
4350
------------------------
@@ -94,30 +101,30 @@ class via annotations:
94101
// src/Acme/TaskBundle/Document/Task.php
95102
namespace Acme\TaskBundle\Document;
96103
97-
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCR;
104+
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;
98105
99106
/**
100-
* @PHPCR\Document()
107+
* @PHPCRODM\Document()
101108
*/
102109
class Task
103110
{
104111
/**
105-
* @PHPCR\Id()
112+
* @PHPCRODM\Id()
106113
*/
107114
protected $id;
108115
109116
/**
110-
* @PHPCR\String()
117+
* @PHPCRODM\String()
111118
*/
112119
protected $description;
113120
114121
/**
115-
* @PHPCR\Boolean()
122+
* @PHPCRODM\Boolean()
116123
*/
117124
protected $done = false;
118125
119126
/**
120-
* @PHPCR\ParentDocument()
127+
* @PHPCRODM\ParentDocument()
121128
*/
122129
protected $parentDocument;
123130
}
@@ -168,8 +175,8 @@ After this, you have to create getters and setters for the properties.
168175
``Nodename``.
169176

170177
A Document must have an id property. This represents the full path (parent
171-
+ name) of the Document. This will be set by Doctrine by default and it is
172-
not recommend to use the id to determine the location of a Document.
178+
path + name) of the Document. This will be set by Doctrine by default and
179+
it is not recommend to use the id to determine the location of a Document.
173180

174181
For more information about identifier generation strategies, refer to the
175182
`doctrine documentation`_
@@ -178,11 +185,11 @@ After this, you have to create getters and setters for the properties.
178185

179186
You can also check out Doctrine's `Basic Mapping Documentation`_ for all
180187
details about mapping information. If you use annotations, you'll need to
181-
prepend all annotations with ``PHPCR\``, which is the name of the imported
182-
namespace (e.g. ``PHPCR\Document(..)``), this is not shown in Doctrine's
183-
documentation. You'll also need to include the use
184-
``use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCR;`` statement, which
185-
imports the PHPCR annotations prefix.
188+
prepend all annotations with ``@PHPCRODM\``, which is the name of the imported
189+
namespace (e.g. ``@PHPCRODM\Document(..)``), this is not shown in Doctrine's
190+
documentation. You'll also need to include the
191+
``use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;`` statement to
192+
import the PHPCR annotations prefix.
186193

187194
Persisting Documents to PHPCR
188195
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -331,14 +338,14 @@ Doctrine, it's already managed.
331338
Deleting an Object
332339
~~~~~~~~~~~~~~~~~~
333340

334-
Deleting an object is very similar, but requires a call to the ``remove()`` method
335-
of the document manager after you fetched the document from PHPCR::
341+
Deleting an object is very similar, but requires a call to the ``remove()``
342+
method of the document manager after you fetched the document from PHPCR::
336343

337344
$documentManager->remove($task);
338345
$documentManager->flush();
339346

340-
As you might expect, the ``remove()`` method notifies Doctrine that you'd like to
341-
remove the given document from PHPCR. The actual delete operation
347+
As you might expect, the ``remove()`` method notifies Doctrine that you'd like
348+
to remove the given document from PHPCR. The actual delete operation
342349
however, is not actually executed until the ``flush()`` method is called.
343350

344351
Summary
@@ -351,19 +358,16 @@ mapping metadata information to map an object's data to a particular database
351358
table.
352359

353360
And even though Doctrine revolves around a simple concept, it's incredibly
354-
powerful, allowing you to create complex queries and subscribe to events that
355-
allow you to take different actions as objects go through their persistence
356-
lifecycle.
361+
powerful, allowing you to `create complex queries`_ and
362+
:doc:`subscribe to events <../bundles/phpcr_odm/events>` that allow you to
363+
take different actions as objects go through their persistence lifecycle.
357364

358365
.. _`Doctrine PHPCR-ODM`: http://docs.doctrine-project.org/projects/doctrine-phpcr-odm/en/latest/index.html
359366
.. _`PHP Content Repository`: http://phpcr.github.io/
360367
.. _`JSR-283 specification`: http://jcp.org/en/jsr/detail?id=283
361368
.. _`Doctrine ORM`: http://symfony.com/doc/current/book/doctrine.html
362-
.. _`Jackalope`: http://jackalope.github.io/
363-
.. _`Apache Jackrabbit`: http://jackrabbit.apache.org/
364-
.. _`jackalope-jackrabbit`: https://github.com/jackalope/jackalope-jackrabbit
365-
.. _`jackalope-doctrine-dbal`: https://github.com/jackalope/jackalope-doctrine-dbal
366369
.. _`doctrine documentation`: http://docs.doctrine-project.org/projects/doctrine-phpcr-odm/en/latest/reference/basic-mapping.html#basicmapping-identifier-generation-strategies
367370
.. _`Basic Mapping Documentation`: http://docs.doctrine-project.org/projects/doctrine-phpcr-odm/en/latest/reference/annotations-reference.html
368371
.. _`the QueryBuilder documentation`: http://docs.doctrine-project.org/projects/doctrine-phpcr-odm/en/latest/reference/query-builder.html
372+
.. _`create complex queries`: http://docs.doctrine-project.org/projects/doctrine-phpcr-odm/en/latest/reference/query-builder.html
369373
.. _`Custom Repository Classes`: http://symfony.com/doc/current/book/doctrine.html#custom-repository-classes

book/installation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ storage medium.
3939
can use one of several available data storage mechanisms without having to
4040
rewrite your code. For more information on the different available
4141
mechanisms and how to install and configure them, refer to
42-
:doc:`../cookbook/installing_configuring_doctrine_phpcr_odm`
42+
:doc:`../bundles/phpcr_odm/introduction`.
4343

4444
Installation
4545
------------
@@ -221,7 +221,7 @@ into the PHPCR database by calling:
221221

222222
.. code-block:: bash
223223
224-
$ php app/console doctrine:phpcr:migrator page --identifier=/cms/simple/test
224+
$ php app/console doctrine:phpcr:migrator:migrate page --identifier=/cms/simple/test
225225
226226
Note that the above identifier is mapped to
227227
``app/Resources/data/pages/test.yml`` by stripping off the ``basepath``
@@ -233,7 +233,7 @@ and then run the following command:
233233

234234
.. code-block:: bash
235235
236-
$ php app/console doctrine:phpcr:migrator page --identifier=/cms/simple/test/foo
236+
$ php app/console doctrine:phpcr:migrator:migrate page --identifier=/cms/simple/test/foo
237237
238238
.. _`cmf.liip.ch`: http://cmf.liip.ch
239239
.. _`Requirements for running Symfony2`: http://symfony.com/doc/current/reference/requirements.html

bundles/blog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Dependencies
3737

3838
* :doc:`CmfRoutingBundle <routing/introduction>` is used to manage the routing;
3939
* :doc:`CmfRoutingAutoBundle <routing_auto/introduction>` is used to manage automatically generate routes;
40-
* :doc:`PHPCR-ODM <phpcr_odm>` is used to persist the bundles documents.
40+
* :doc:`PHPCR-ODM <phpcr_odm/introduction>` is used to persist the bundles documents.
4141

4242
Configuration
4343
-------------

bundles/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Bundles
99
content/index
1010
core/index
1111
create/index
12-
phpcr_odm
12+
phpcr_odm/index
1313
media/index
1414
menu/index
1515
routing_auto/index

bundles/map.rst.inc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,14 @@ Contributed Bundles
9292
Besides that, the Symfony CMF team also maintains some 3th party bundles which
9393
help with integrating PHPCR concepts into the Symfony Framework.
9494

95-
* **DoctrinePHPCRBundle**
96-
97-
* :doc:`phpcr_odm`
95+
* :doc:`phpcr_odm/index`
96+
97+
* :doc:`phpcr_odm/introduction`
98+
* :doc:`phpcr_odm/events`
99+
* :doc:`phpcr_odm/forms`
100+
* :doc:`phpcr_odm/fixtures_initializers`
101+
* :doc:`phpcr_odm/multilang`
102+
* :doc:`phpcr_odm/multiple_sessions`
98103

99104
* SonataDoctrinePHPCRAdminBundle_
100105

0 commit comments

Comments
 (0)