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

Commit 7975900

Browse files
committed
Merge pull request #481 from symfony-cmf/cleanup-phpcrodm-annotation
Cleanup phpcrodm annotation
2 parents 3c76343 + fb6d265 commit 7975900

File tree

8 files changed

+28
-18
lines changed

8 files changed

+28
-18
lines changed

book/database_layer.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,30 +101,30 @@ class via annotations:
101101
// src/Acme/TaskBundle/Document/Task.php
102102
namespace Acme\TaskBundle\Document;
103103
104-
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;
104+
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCR;
105105
106106
/**
107-
* @PHPCRODM\Document()
107+
* @PHPCR\Document()
108108
*/
109109
class Task
110110
{
111111
/**
112-
* @PHPCRODM\Id()
112+
* @PHPCR\Id()
113113
*/
114114
protected $id;
115115
116116
/**
117-
* @PHPCRODM\String()
117+
* @PHPCR\String()
118118
*/
119119
protected $description;
120120
121121
/**
122-
* @PHPCRODM\Boolean()
122+
* @PHPCR\Boolean()
123123
*/
124124
protected $done = false;
125125
126126
/**
127-
* @PHPCRODM\ParentDocument()
127+
* @PHPCR\ParentDocument()
128128
*/
129129
protected $parentDocument;
130130
}
@@ -185,10 +185,10 @@ After this, you have to create getters and setters for the properties.
185185

186186
You can also check out Doctrine's `Basic Mapping Documentation`_ for all
187187
details about mapping information. If you use annotations, you'll need to
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
188+
prepend all annotations with ``@PHPCR\``, which is the name of the imported
189+
namespace (e.g. ``@PHPCR\Document(..)``), this is not shown in Doctrine's
190190
documentation. You'll also need to include the
191-
``use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;`` statement to
191+
``use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCR;`` statement to
192192
import the PHPCR annotations prefix.
193193

194194
Persisting Documents to PHPCR

book/structuring_content.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ translations:
168168
.. code-block:: php-annotations
169169
170170
/**
171-
* @PHPCRODM\Document(translator="attribute")
171+
* @PHPCR\Document(translator="attribute")
172172
*/
173173
174174
For information on the available translation strategies, refer to the Doctrine

bundles/block/create_your_own_blocks.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ for instance ``acme_main.block.rss``::
3636
namespace Acme\MainBundle\Document;
3737

3838
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCR;
39+
3940
use Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\AbstractBlock;
4041

4142
/**

bundles/menu/menu_factory.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ The service needs to be tagged as event listener:
160160
acme_demo.listener.menu_referrer_listener:
161161
class: Acme\DemoBundle\EventListener\CreateMenuItemFromNodeListener
162162
arguments:
163-
- @knp_menu.menu_provider
163+
- "@knp_menu.menu_provider"
164164
tags:
165165
-
166166
name: kernel.event_listener

bundles/phpcr_odm/multilang.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,25 +117,25 @@ depending on the locale.
117117
{
118118
/**
119119
* The language this document currently is in
120-
* @Locale
120+
* @PHPCR\Locale
121121
*/
122122
private $locale;
123123
124124
/**
125125
* Untranslated property
126-
* @Date
126+
* @PHPCR\Date
127127
*/
128128
private $publishDate;
129129
130130
/**
131131
* Translated property
132-
* @String(translated=true)
132+
* @PHPCR\String(translated=true)
133133
*/
134134
private $topic;
135135
136136
/**
137137
* Language specific image
138-
* @Binary(translated=true)
138+
* @PHPCR\Binary(translated=true)
139139
*/
140140
private $image;
141141
}

cookbook/creating_a_cms/getting-started.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ to reduce code duplication::
102102
// src/Acme/BasicCmsBundle/Document/ContentTrait.php
103103
namespace Acme\BasicCmsBundle\Document;
104104

105+
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCR;
106+
105107
trait ContentTrait
106108
{
107109
/**
@@ -185,9 +187,10 @@ The ``Page`` class is therefore nice and simple::
185187
// src/Acme/BasicCmsBundle/Document/Page.php
186188
namespace Acme\BasicCmsBundle\Document;
187189

188-
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCR;
189190
use Symfony\Cmf\Component\Routing\RouteReferrersReadInterface;
190191

192+
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCR;
193+
191194
/**
192195
* @PHPCR\Document(referenceable=true)
193196
*/

cookbook/creating_a_cms/the-frontend.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ KnpMenuBundle::
5050
// ...
5151
use Knp\Menu\NodeInterface;
5252

53+
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCR;
54+
5355
class Page implements RouteReferrersReadInterface, NodeInterface
5456
{
5557
// ...

cookbook/handling_multilang_documents.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,18 @@ always happens on a document level, not on the individual translatable fields.
5151
5252
<?php
5353
54+
// src/Acme/DemoBundle/Document/MyPersistentClass.php
55+
56+
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCR;
57+
5458
/**
55-
* @PHPCRODM\Document(translator="attribute")
59+
* @PHPCR\Document(translator="attribute")
5660
*/
5761
class MyPersistentClass
5862
{
5963
/**
6064
* Translated property
61-
* @String(translated=true)
65+
* @PHPCR\String(translated=true)
6266
*/
6367
private $topic;
6468

0 commit comments

Comments
 (0)