tomas-pecserke/YamlFixturesBundle — pull request #6 by mhlavac (2014-05-21 09:08:05+00:00)
Title: Added refresh to fix problem with entity relation dependencies

I've got a problem with entity relations. When one entity depends on some collection of other entity, then this collection is not refreshed with newly added entities.

Example:
We have 3 entities:
* User (items)
* Item (price, user)
* Payment (total_price, user)

1. We create user with no items.
2. We create few items with reference to user.
3. We create new payment with reference to user. When user is set, total_price is calculated, but the problem is that User was not refreshed and User object has empty collection at this point.

Refresh fixed this problem for me. I am not sure how to test this properly though. `InMemoryObjectManager` does nothing on refresh and keeps everything in memory and I don't want to add external requirements to run tests.

Any ideas? Maybe there are other solutions how to solve this.