[TYPO3-mvc] Use 2 Repositories in 1 Controller?

Roland most.wanted at gmx.at
Tue Nov 15 15:50:56 CET 2011


Hello everybody,

I built an extbase extension with the extension builder. it has 20 
objects: 2 of them ar "Brand" and "Product".

These 2 objects are both aggregate roots and n:1-associated with each other.

The only fe-plugin outputs this:

+ list of all products
+ list of all products of a specific brand
+ list of all products of a specific producer
+ list of all products of a specific type
+ details of a specific product

Therefore i have implemented these methods in ProductRepository.php:

+ findByBrand()
+ findByProducer()
+ findByType()

In ProduktController.php the products that should be displayed are 
assigned to the view (via URL-parameters and a switch statement).

This already works!

MY PROBLEM WITH THE LIST OF PRODUCTS OF A SPECIFIC BRAND: the name of 
the brand and an descriptive text to the brand must be output right 
before the list.

The object "Brand" already has the attributes "name" and "text".

Unfortunatelly i don't know how to get this data into the Fluid template.

I already tried zu inject the BrandRepository into the 
ProductController, so that the ProductController would have access to 
the data of the ProductRepository and the BrandRepository. It did not 
work. "name" and "text" was NOT output.

does anybody have a tipp?

Kind regards.

Roland



PS: i already sent this (in german) to the typo3.german TYPO3 mailing 
list - i hope it is ok to do so!?


More information about the TYPO3-project-typo3v4mvc mailing list