@@ -37,23 +37,24 @@ The result will be the PHPCR tree:
37
37
38
38
ROOT:
39
39
cms:
40
- content:
41
- blocks:
42
- hero_unit:
43
- quick_tour:
44
- configure:
45
- demo:
46
40
simple:
47
- home:
48
- demo:
49
- quick_tour:
50
- login:
51
- menu:
41
+ about:
42
+ contact:
43
+ map:
44
+ team:
45
+ quick_tour:
46
+ dynamic:
47
+ docs:
48
+ demo:
49
+ demo_redirect:
50
+ hardcoded_dynamic:
51
+ hardcoded_static:
52
52
53
53
Each data is called a *node * in PHPCR. In this tree, there are 13 nodes and
54
54
one ROOT node (created by PHPCR). You may have already seen the document you
55
55
created in the previous section, it's called ``quick_tour `` (and it's path is
56
- ``/cms/simple/quick_tour ``).
56
+ ``/cms/simple/quick_tour ``). When using the SimpleCmsBundle, all nodes are
57
+ stored in the ``/cms/simple `` path.
57
58
58
59
Each node has properties, which contain the data. The content, title and label
59
60
you set for your page are saved in such properties for the ``quick_tour ``
@@ -62,8 +63,8 @@ dump command.
62
63
63
64
.. note ::
64
65
65
- Previously, the PHPCR tree was compared with a Filesystem . While this
66
- gives you a good imagine of what happends , it's not the truth. You can
66
+ Previously, the PHPCR tree was compared with a FileSystem . While this
67
+ gives you a good image of what happens , it's not the truth. You can
67
68
better compare it to an XML file, where each node is an element and its
68
69
properties are attributes.
69
70
@@ -84,10 +85,10 @@ a page by using a yaml file which was parsed by the SimpleCmsBundle. This
84
85
time, you'll create a page by doing it yourself.
85
86
86
87
First, you have to create a new DataFixture to add your new page. You do this
87
- by creating a new class in the AcmeDemoBundle ::
88
+ by creating a new class in the AcmeMainBundle ::
88
89
89
- // src/Acme/DemoBundle /DataFixtures/PHPCR/LoadPageData.php
90
- namespace Acme\DemoBundle \DataFixtures\PHPCR;
90
+ // src/Acme/MainBundle /DataFixtures/PHPCR/LoadPageData.php
91
+ namespace Acme\MainBundle \DataFixtures\PHPCR;
91
92
92
93
use Doctrine\Common\Persistence\ObjectManager;
93
94
use Doctrine\Common\DataFixtures\FixtureInterface;
@@ -97,11 +98,11 @@ by creating a new class in the AcmeDemoBundle::
97
98
{
98
99
public function getOrder()
99
100
{
100
- // refers to the order in which the class' load function is called
101
+ // refers to the order in which the class' load function is called
101
102
// (lower return values are called first)
102
103
return 10;
103
104
}
104
-
105
+
105
106
public function load(ObjectManager $documentManager)
106
107
{
107
108
}
@@ -134,7 +135,7 @@ it as its parent::
134
135
// get root document (/cms/simple)
135
136
$simpleCmsRoot = $documentManager->find(null, '/cms/simple');
136
137
137
- $page->setParentDocument ($simpleCmsRoot); // set the parent to the root
138
+ $page->setParent ($simpleCmsRoot); // set the parent to the root
138
139
}
139
140
140
141
And at last, we have to tell the Document Manager to persist our Page
0 commit comments