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

Commit d7c26ab

Browse files
committed
Merge branch '1.0'
Conflicts: _exts quick_tour/the_model.rst
2 parents 24c18c0 + 7c854dc commit d7c26ab

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

quick_tour/the_model.rst

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,24 @@ The result will be the PHPCR tree:
3737
3838
ROOT:
3939
cms:
40-
content:
41-
blocks:
42-
hero_unit:
43-
quick_tour:
44-
configure:
45-
demo:
4640
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:
5252
5353
Each data is called a *node* in PHPCR. In this tree, there are 13 nodes and
5454
one ROOT node (created by PHPCR). You may have already seen the document you
5555
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.
5758

5859
Each node has properties, which contain the data. The content, title and label
5960
you set for your page are saved in such properties for the ``quick_tour``
@@ -62,8 +63,8 @@ dump command.
6263

6364
.. note::
6465

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
6768
better compare it to an XML file, where each node is an element and its
6869
properties are attributes.
6970

@@ -84,10 +85,10 @@ a page by using a yaml file which was parsed by the SimpleCmsBundle. This
8485
time, you'll create a page by doing it yourself.
8586

8687
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::
8889

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;
9192

9293
use Doctrine\Common\Persistence\ObjectManager;
9394
use Doctrine\Common\DataFixtures\FixtureInterface;
@@ -97,11 +98,11 @@ by creating a new class in the AcmeDemoBundle::
9798
{
9899
public function getOrder()
99100
{
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
101102
// (lower return values are called first)
102103
return 10;
103104
}
104-
105+
105106
public function load(ObjectManager $documentManager)
106107
{
107108
}
@@ -134,7 +135,7 @@ it as its parent::
134135
// get root document (/cms/simple)
135136
$simpleCmsRoot = $documentManager->find(null, '/cms/simple');
136137

137-
$page->setParentDocument($simpleCmsRoot); // set the parent to the root
138+
$page->setParent($simpleCmsRoot); // set the parent to the root
138139
}
139140

140141
And at last, we have to tell the Document Manager to persist our Page

0 commit comments

Comments
 (0)