[TYPO3-mvc] repository->add => persistenceManager->persistAll => repository->findBy

Franz Koch typo3.RemoveForMessage at elements-net.de
Mon Jul 12 02:26:38 CEST 2010


Hey,

> My Cart model is defining the product as follow:
> /**
> * @var Tx_BwShop_Domain_Model_Products
> */
> protected $product;

I'm kind of confused by your domain structure and naming, so I'm not 
sure where the problem could come from. As it seems, your cart can only 
have one product? If so, then the class name of the model feels odd as 
it implicates plural - or might this be misspelled and be the error?

If you on the other hand allow multiple products (which I assume) in 
your cart, then you don't need a "product" property, but a "products" 
(plural) and make it a objectStorage:

/**
  * The products currently in the cart
  * @var 
Tx_Extbase_Persistence_ObjectStorage<Tx_BwShop_Domain_Model_Product>
  */
  protected $products;


Maybe there is the error?

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list