Accessors in CommandBox Module?

Hey All,

I’m creating a module for CommandBox and ran into something I thought was strange. I put a CFC in the models folder then tried to set and get a value using the CF implied getters and setters.

<cffunction name="tryme">
   <cfset thisd=createobject('component','kimdirectory')>
   <cfset setTechsitedirpackage('ggg')>
   <cfreturn getTechsitedirpackage()>
</cffunction>

I got the following error:

ORM is not enabled

C:\Users\djcar.CommandBox\cfml\modules\KIM\models\com\purposefultechnologies\kim\systemmodeling\KimDirectory.cfc: line 172
170:
171: <cfset thisd=createobject(‘component’,‘kimdirectory’)>
172: <cfset setTechsitedirpackage(‘ggg’)>
173: <cfreturn getTechsitedirpackage()>
174:

I tried the following and it worked fine:

<cfset thisd=createobject('component','kimdirectory')>
<cfset Techsitedirpackage='ggg'>
<cfreturn Techsitedirpackage>


Do the implied Getters and setters not work inside a CommandBox Module? I actually made expliit getters and setters and it still kept complaining about ORM. Am I missing something basic about wirebox?

Dan 

Dan,

Do you have persistent="true" in your component attributes or any ORM-specific attributes in your properties? If so, that would throw the ORM error you are seeing.

Jon

Ah, yes. Yes I do and it did. Thanks!

Dan