Just a little hint.
I would prefer restructuring the way your organize your schema in order to properly retrieve all associated fields. For instance, according to this line of your question "if I have customer associated to product", I believe you have at least one-to-one or one-to-many relationship between customer and product. If you declare these relationships in your ORM, if you use YAML or annotations or any preferred/give way, you will be able to retrieve field names with a standard DQL query / or get methods.
The point to taken from here is, when you are expecting associating fields to be retrieved, it's best if you establish a solid database schema by providing relevant relationships at first place. This will reduce the job you have to do by half and will increase the performance in system/coding practice in long run.
Hope this helps,
Cheers!