[TYPO3-mvc] extension_builder and Repositories

Tim Schoch | GSTALTIG tim.schoch at gstaltig.ch
Mon Feb 13 15:48:36 CET 2012


Hello Toke

This may differ. If you need to access your models directly, say to create a dropdown-list to choose from,
you need an own repository for this model even if ist not an aggregate root. But if your model is created as a
sub-model, you don't need an own repo.

Eg with repo:
A client can be assigned to a category. You need to pass all categories to the view, to create the select field.
$this->view->assign( 'categories', $this->categoryRepository->findAll() );

Eg without repo:
A client has several employees you access only through your client using foreach( $client->getEmployees() as $slave ) { ... }. In this case there is no need for a dedicated repository.

I hope this helps, tim
 
GSTALTIG GMBH / www.gstaltig.ch
Sonnenhofstr. 13 / 6020 Emmenbrücke
tim at gstaltig.ch / 076 488 24 9



More information about the TYPO3-project-typo3v4mvc mailing list