[TYPO3-mvc] Question about relations
Christine Gerpheide
cgerpheide at gmail.com
Wed Mar 17 02:05:32 CET 2010
Hi Kai,
In your Price class, is the bonusDollars property an ObjectStorage? Object
storages are only meant to contain one instance of an object, in which case
you can change it to an array. This has at least worked for me with MM
tables defined in the TCA (and in your case.. shouldn't this also use a many
to many table?)
Hope that helps,
Christine
2010/3/15 Kai <kai.tallafus at gmx.at>
> Hi all,
>
> I am building a small shop with extbase. Despite of paying a product with
> money, the customer can redeem sort of bonus points and and pay with them.
> The price of a product is composed of multiple "bonus point units", let´s
> call them "BonusDollars". So if a product costs 110 bonus points the price
> is composed of 50 BonusDollars + 50 BonusDollars + 10 BonusDollars. (Each of
> them are displayed as coin icons in the shop)
>
> So we have the following structure: product HAS MANY bonusdollars
>
> To add the same units multiple times, I defined it as select with
> 'multiple' => '1':
>
> 'price' => array(
> 'exclude' => 0,
> 'label' =>
> 'LLL:EXT:colteneshop/Resources/Private/Language/locallang_db.xml:tx_myshop_domain_model_product.price',
> 'config' => array(
> 'type' => 'select',
> 'foreign_table' =>
> 'tx_myshop_domain_model_bonusdollar',
> 'maxitems' => 9999,
> 'size' => '5',
> 'multiple' => '1',
> )
> ),
>
>
> My problem is how extbase collects the data for the related dollars during
> the mapping process.
> For a product which has 50 + 50 + 10 dollars i only get the relations for
> 50 and 10. As far as I can see this is due the fact that relations are
> fetched with a single sql statement like SELECT ... FROM table WHERE uid IN
> (...).
>
> Do I miss something or is there currently no solution for this?
>
> Btw. extbase is fun :-)
>
> Greets
> Kai
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>
More information about the TYPO3-project-typo3v4mvc
mailing list