Bug #4755

findAll() does not return the just before added item.

Added by Falk Kühnel about 12 years ago. Updated about 11 years ago.

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

100%

Estimated time:
PHP Version:
Has patch:
Complexity:

Description

When adding an item to a repository and immediately thereafter calling the findAll() method, the just added items are not returned.

$customer = $this->objectFactory->create('F3\Projects\Domain\Model\Customer');
$customer->setFirstName($this->rand_str(rand(5,32)));
$customer->setLastName($this->rand_str(rand(5,32)));
$this->customerRepository->add($customer);
$this->view->assign('customers', $this->customerRepository->findAll());

Happens with revision 3915 on windows vista. Havent tried anything else.

#1

Updated by Karsten Dambekalns about 12 years ago

  • Status changed from New to Accepted
  • Assignee set to Karsten Dambekalns
  • Target version set to 1.0 alpha 5

Just a sidenote: for generating fake data, try Faker...

#2

Updated by Falk Kühnel about 12 years ago

Oh, i havent seen Faker yet. Thanks for the hint. Saves quite some work with dummy data ;)

#3

Updated by Karsten Dambekalns about 12 years ago

This is not a bug but intended behaviour. I'll add an explanation to the persistence chapter of the FLOW3 manual.

#4

Updated by Falk Kühnel about 12 years ago

Karsten Dambekalns wrote:

This is not a bug but intended behaviour. I'll add an explanation to the persistence chapter of the FLOW3 manual.

Very confusing. Why is it intended? I personally would expect to retrieve all Items from the Repository, even the ones, that did not yet get persisted. Cant wait for that chapter :)

#5

Updated by Karsten Dambekalns about 12 years ago

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

Applied in changeset r3238.

Also available in: Atom PDF