[TYPO3-mvc] RFC #11230: Allow multiple repositories per model class and add unit tests for the persistence manager

Oliver Klee typo3-german-01 at oliverklee.de
Thu Dec 2 17:51:38 CET 2010


This is a SVN patch request.

Type: Bugfix

Bugtracker reference:
http://forge.typo3.org/issues/11230

Branches:
trunk


Problem:

1. Currently, it is not possible to have more than one repository class
(e.g. a DB repository and a web service repository) for the same model
class because PersistenceManager::persistAll checks for the existence of
a name-based repository class.

2. The persistence manager has no unit tests for persistAll.


Solution:

1. When checking for aggregate root objects for the reconstituted models
from the session, the persistence manager also needs to take the
repositories into account which it already knows about.

2. Add full unit tests for persistAll.


How to test:
Read and run the unit tests.

And if you want to test manually, create a repository with a name that
is different from the model name. ->findByUid a model, ->remove it and
->persistAll. The model then should be gone from the DB, but actually
still is there.



Note: You'll also need to apply the patch from #11229.


All the best,



Oli


More information about the TYPO3-project-typo3v4mvc mailing list