I find myself frequently needing nodes for structuring purposes for which I dont really need a document aside from the fact that it would make some things easier, like being able to access children.
For example structuring articles by date:
/2011/07/11/foo
/2011/07/11/bar
It could be convenient to just fetch "/2011/07/11" and get all the child nodes via PHPCR ODM
For this purpose I found myself implementing a "Subnode" Document in my code, but I wonder if we shouldnt ship such a Document with PHPCR ODM and optionally "cast" any node that wasn't requested with a specific document name and also didnt have a document name stored to this type?
regards,
Lukas Kahwe Smith
m...@pooteeweet.org
+1
- --
Liip AG // Agile Web Development // T +41 26 422 25 11
CH-1700 Fribourg // PGP 0xA581808B // www.liip.ch
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk4fI20ACgkQqBnXnqWBgIsx0QCbBUKpa2+TjlCKY8y5C6G54AwB
DzcAn001HOgTwCQ8OQqUMfTCgs3ArI6o
=Ziu3
-----END PGP SIGNATURE-----
while for your use case you could use the already existing "Folder"
document, this makes sense for me too as this will allow the odm to
read any nodes ... so
+1
Ciao
Uwe
2011/7/11 Lukas Kahwe Smith <m...@pooteeweet.org>:
> Hi,
>
> while for your use case you could use the already existing "Folder"
> document, this makes sense for me too as this will allow the odm to
> read any nodes ... so
> +1
yeah .. i guess we should then also call the document "Folder".
well, no, Folder has a jcr node type nt:folder ...
Kind regards
Uwe
2011/7/19 Lukas Kahwe Smith <m...@pooteeweet.org>:
> Hi,
>
> well, no, Folder has a jcr node type nt:folder ...
>
>
> Kind regards
> Uwe
>
> 2011/7/19 Lukas Kahwe Smith <m...@pooteeweet.org>:
>>
>> On 14.07.2011, at 21:03, Uwe Jäger wrote:
>>
>>> Hi,
>>>
>>> while for your use case you could use the already existing "Folder"
>>> document, this makes sense for me too as this will allow the odm to
>>> read any nodes ... so
>>> +1
>>
>>
>> yeah .. i guess we should then also call the document "Folder".
err .. got confused there. so there already is a Folder document, so there is nothing to add?
regards,
Lukas Kahwe Smith
sm...@pooteeweet.org
there is a Folder document that maps the nt:folder node type, which is a
special type that can only contain nt:resource nodes (or nt:file?).
the generic document would map any jcr node type. but essentually have
the same functionality: mapping the child nodes.
cheers,david
Am 19.07.2011 16:10, schrieb Lukas Kahwe Smith:
>
> On 19.07.2011, at 16:07, Uwe J�ger wrote:
>
>> Hi,
>>
>> well, no, Folder has a jcr node type nt:folder ...
>>
>>
>> Kind regards
>> Uwe
>>
>> 2011/7/19 Lukas Kahwe Smith <m...@pooteeweet.org>:
>>>
>>> On 14.07.2011, at 21:03, Uwe J�ger wrote:
>>>
>>>> Hi,
>>>>
>>>> while for your use case you could use the already existing "Folder"
>>>> document, this makes sense for me too as this will allow the odm to
>>>> read any nodes ... so
>>>> +1
>>>
>>>
>>> yeah .. i guess we should then also call the document "Folder".
>
> err .. got confused there. so there already is a Folder document, so there is nothing to add?
>
> regards,
> Lukas Kahwe Smith
> sm...@pooteeweet.org
>
>
>
- --
Liip AG // Agile Web Development // T +41 26 422 25 11
CH-1700 Fribourg // PGP 0xA581808B // www.liip.ch
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk4llnkACgkQqBnXnqWBgIsQhwCghaeyDIdswsRzmfFSobTLdlif
RBwAn1i4TF8fPjj2oe0vj4UIC5GXn7ZU
=2MdJ
-----END PGP SIGNATURE-----
bumping this old thread: there is now one for this, which is used if no
mapping is found instead of throwing an exception. it just maps parent
and children.
see https://github.com/doctrine/phpcr-odm/pull/66
cheers,
david
iEYEARECAAYFAk6iwhwACgkQqBnXnqWBgIsoGQCgrWnPaUfjR09oG/QzcRA4VSfO
Cb0An3GUqfCnaWCXClmpadyexJQtx3Es
=Guhv
-----END PGP SIGNATURE-----