[TYPO3-mvc] How to select for the first object in an object storage related to a root object?

Oberndörfer, Markus Markus.Oberndoerfer at rossmann.de
Tue Nov 2 13:17:42 CET 2010


Hi everybody,

I wonder if there is a possibility to select for the first object in an object tree.

In the frontend I have a select box where I can alter the sorting of several categories of an article. The article is the aggregate root and the 1 up to x categories are stored in an object storage related to this root object.

[debugging start]
...

[categories:protected] => Tx_Extbase_Persistence_ObjectStorage Object
        (
            [storage:protected] => Array
                (
                    [d4ced8c63908203dd7e9d073eec0f525] => Array
                        (
                            [obj] => Tx_Sfmarticle_Domain_Model_Category Object
                                (
                                    [title:protected] => showering
                                    [description:protected] => Having a shower.
                                    [parentcategory:protected] => 1
                                    [categoryicon:protected] =>
                                    [uid:protected] => 2
                                    [_localizedUid:protected] => 2
                                    [_languageUid:protected] => 0
                                    [_isClone:private] =>
                                )

                            [inf] =>
                        )

                    [d722c0e6242b5121f354ffa8e5907ffb] => Array
                        (
                            [obj] => Tx_Sfmarticle_Domain_Model_Category Object
                                (
                                    [title:protected] => bathing
                                    [description:protected] => Having a bath.
                                    [parentcategory:protected] => 1
                                    [categoryicon:protected] =>
                                    [uid:protected] => 3
                                    [_localizedUid:protected] => 3
                                    [_languageUid:protected] => 0
                                    [_isClone:private] =>
                                )

                            [inf] =>
                        )

                )

            [isModified:protected] =>
        )
...
[debugging end]

The editor of the article shall set one of the categories as a primary object by sorting it up to first position in the backend flexform. Actually this sorting alters the output of the debugging view of the object tree. The first category in the backend is here shown first.

So now I would like to have a $query-structure in the repository, that delivers only the root objects that e.g. have the category "bathing" as first category. Is there any constraint for an index of the sub-objects available? In the example a $query->matching($query->equals('categories.title','bathing')) returns the root object above.

Best regards to everyone

Markus Oberndörfer
Anwendungsentwicklung TYPO3/ PHP

Dirk Rossmann GmbH
Isernhägener Straße 16
30938 Burgwedel
* +49 (05139) 898 - 4860
* +49 (05139) 898 - 4171
* markus.oberndoerfer at rossmann.de
       www.rossmann.de<http://www.rossmann.de>

Handelsregister-Nr. HRB 120546, Amtsgericht Hannover
Ust-Id-Nr. DE 115055186
St.-Nr. 16 / 205 / 65401
Geschäftsführer: Dirk Roßmann, Alice Schardt-Roßmann, Roland Frobel, Klaus Praus




More information about the TYPO3-project-typo3v4mvc mailing list