Doctrine 2 - ORM

[GH-392] Replaced a shallow-copy with a deep-copy to avoid side effects.