Bug #3837

Objects added to a repository are not found if repository doesn't follow naming conventions

Added by Robert Lemke about 10 years ago. Updated almost 9 years ago.

Status:
Resolved
Priority:
Must have
Category:
Persistence
Start date:
2009-07-07
Due date:
% Done:

100%

PHP Version:
Has patch:
Complexity:

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.

Associated revisions

Revision eff687d8 (diff)
Added by Karsten Dambekalns about 10 years ago

[+BUGFIX] FLOW3 (Persistence): when handing objects over to a Repository instance their type is now checked against the type managed by the Repository instance, fixes #3837.

Revision 09998409 (diff)
Added by Karsten Dambekalns about 10 years ago

[~BUGFIX] FLOW3 (Persistence): when handing objects over to a Repository instance their type is now checked against the type managed by the Repository instance, fixes #3837.

Revision b3bfc47f (diff)
Added by Karsten Dambekalns about 10 years ago

[~BUGFIX] FLOW3 (Persistence): Fixed two tests I overlooked, relates to #3837.

History

#1 Updated by Robert Lemke about 10 years ago

  • Assignee set to Karsten Dambekalns

#2 Updated by Karsten Dambekalns about 10 years ago

  • Status changed from New to Accepted

#3 Updated by Karsten Dambekalns about 10 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

Applied in changeset r2877.

Also available in: Atom PDF