How do you loop over the properties of an object?
I have this CFC and I have properties defined
property name="firstname" getter="true" setter="true" type="string";
property name="lastname" getter="true" setter="true";
I'm trying to loop over these properties and trim the values.
First thing that popped into my mind was looping over a collection.
Yes, me too, but what would be syntax. I can dump the object and I see the properties and the methods, but how do I loop over the properties within the CFC.
I'm looking for specific syntax that would allow me to loop over the properties in a CFC.
I'm not in front of my computer to verify this, but I'm pretty sure properties aren't automatically exposed as a collection. You need to use getMetadata() and they're exposed in the returned struct.