Bug #3837
Objects added to a repository are not found if repository doesn't follow naming conventions
100%
Description
We have a model called \F3\TYPO3\Domain\Model\Structure\Site and a repository called \F3\TYPO3\Domain\Repository\SiteRepository.
Note that the repository doesn't follow the naming conventions – it should rather be called \F3\TYPO3\Domain\Repository\Structure\SiteRepository.
If a Site object is added to the (first) repository, it will be sucessfully stored in the CR. However, executing findAll() on the repository won't return any object because the repository's createQuery() method assumes the correct (second) repository name. This is a good thing but should also be enforced while adding objects.
Solution:
Define the model class name during construction / initialization of the repository and use that name everywhere in the repository functions to check objects passed to the repository against it.