How to get Doctrine 2 to return an entity instead of a proxy
问题 I'm trying to implement deep copy functionality using Doctrine 2, and I almost have it except for a method on one of my entities that attempts to strip out certain records from an association before returning the collection. The problem is that when I call getRoofAreas() below, I get an array of Proxy objects, which my deep copy code doesn't like: /** * @OneToMany(targetEntity="\Entities\QuotingRoofAreas", mappedBy="customerId", cascade={"persist"}) * @OrderBy({"areaIndex" = "ASC"}) */