[TYPO3-mvc] Basket / session question
Webmeck - TYPO3
typo3 at webmeck.de
Fri Feb 15 13:41:14 CET 2013
Hi Jan,
no, it wont break the MVC concept.
I think its okay, but Im not sure if it is the cleanest way.
kind regarts
frederik
On 14.02.2013 23:44, Jan Kornblum wrote:
> Hi vosberg,
>
> thanks a lot!
>
>> when you add an attribute to the product-class it wont be persisted
>> automatically. You must not define it in the tca.
>
> This is good to know :)
>
>> So I would:
>> add the isInBasket attribute to the product with getters/setters.
>>
>> add a method to the basket markInBasketProducts($products), which
>> iterates through the given products and sets the attribute.
>>
>> This method I would call in the controller.
>
> You mean calling this method inside the ProductController, right?
> Retrieving the products from repository, then passing the products to
> this method, getting the adjusted products returned and passed to the
> view...
>
> Could this also be realized as an additional method inside the
> ProductRepository? Like getProductsWithBasketInformation(), which
> first gets the products from repo, and then does a
> basket->markInBasketProducts($products)? Or would this break ddd/mvc
> logic?
>
> Kind regards, Jan
>
>
> _______________________________________________
> 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