fzaninotto/Faker — pull request #475 by lexicalbits (2014-12-11 02:44:54+00:00)
Title: Doctrine orm polish

I made 2 changes to facilitate my use of Faker against Doctrine entities.

First, to track down formatter errors, I re-throw the InvalidArgumentException with the specific class name and field name that failed. This helped me track down several issues I had tracking down decimal fields that were bigger than mt_getrandmax.

Second, Doctrine entities usually have setters for their properties, and those setters can have their own behaviors (regenerating slugs on setting a title, passing relationship assignment between owner and inversion, etc.). I therefore thought trying to use the setter to assign a value before falling back on reflection might improve the resulting object mockup. The reflection strategy is useful for hydration, where the data has already been established and is merely being re-loaded into an object, not for creating new data, as the EntityPopulator is trying to do.