Created
September 9, 2011 15:46
-
-
Save joeyblake/1206562 to your computer and use it in GitHub Desktop.
Get ORM Model Extra Attribute Data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cffunction name="getModelDescDefault"> | |
<cfargument name="model" required="true"> | |
<cfset z = CreateObject('models.#arguments.model#')> | |
<cfset fieldStruct = {}> | |
<cfloop array="#getMetaData(z).properties#" index="i"> | |
<cfif StructKeyExists(i,'desc')> | |
<cfset fieldStruct['#i.name#']['desc'] = #i.desc#> | |
<cfset fieldStruct['#i.name#']['default'] = #i.default#> | |
</cfif> | |
</cfloop> | |
<cfreturn fieldStruct> | |
</cffunction> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment