i have a document 'Page' which should have different "elements" of unstructured content on the page.
The mapping of my document is loaded properly (i can create documents) and it looks like that:
<document name="Gondoliere\CoreBundle\Document\Page">
<nodename name="title" />
<field name="name" type="string" nullable="true" />
<parent-document name="parentDocument" />
<children name="contents" fetch-depth="3" />
</document>
I expect the $home->getContents()
to return a collection with my items.
The node:dump --props looks like that:
Home:
- jcr:primaryType = nt:unstructured
- jcr:mixinTypes = Array( [0] => phpcr:managed)
- phpcr:class = Gondoliere\CoreBundle\Document\Page
- phpcr:classparents = Array()
- name = Startseite
687509281:
- jcr:primaryType = nt:unstructured
- jcr:mixinTypes = Array( [0] => phpcr:managed)
- phpcr:class = Gondoliere\CoreBundle\Document\SimpleElement
- phpcr:classparents = Array()
- headline = Willkommen
- body = hier kommt mein Text
Somehow $home->getContents()->count()
is always 0
.
What am I doing wrong. Page::getContents method looks like that:
public function getContents()
{
return $this->contents;
}