stephpy/TimelineBundle — pull request #44 by brentc (2012-11-14 14:41:06+00:00)
Title: Add option to DataHydrator to filter entities with unresolved references

My implementation did not throw/catch any exceptions when `EntityListener` [creates references to removed objects](https://github.com/stephpy/TimelineBundle/blob/master/Entity/EntityListener.php#L62).

This is due to the fact that references are generated without any communication with the persistence layer (this forms the basis of Doctrine's Lazy-Loading functionality).

Instead, whenever the lazy-loading kicks in (depending on where in your code you finally access a non-id field for the object), the EM will finally throw an `EntityNotFoundException`.

This typically happens at some point during the action component rendering process. But the only way to handle it there would be to explicitly load the object (`$component->__load()`) within a `try/catch`, but that since you don't know how devs will be rendering their actions, this may create unnecessary db queries on components not actually rendered.

Instead, this PR adds an option to the `DataHydrator` which will filter any actions which have unresolved references.

The option is disabled by default.