PageRenderTime 14ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/wheels/tests/_assets/models/Tag.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 49 lines | 40 code | 9 blank | 0 comment | 0 complexity | c959f23ba0f151fec1f73d754ef34d9d MD5 | raw file
Possible License(s): Apache-2.0, CPL-1.0
  1. <cfcomponent extends="Model">
  2. <cffunction name="init">
  3. <cfset belongsTo(name="parent", modelName="tag", foreignKey="parentid", joinType="outer")>
  4. <cfset hasMany(name="children", modelName="tag", foreignKey="parentid")>
  5. <cfset hasMany(name="classifications")>
  6. <cfset beforeSave("callbackThatReturnsTrue")>
  7. <cfset property(name="name", label="Tag name")>
  8. <cfset property(name="virtual", label="Virtual property")>
  9. </cffunction>
  10. <cffunction name="callbackThatIncreasesVariable">
  11. <cfif NOT StructKeyExists(this, "callbackCount")>
  12. <cfset this.callbackCount = 0>
  13. </cfif>
  14. <cfset this.callbackCount++>
  15. </cffunction>
  16. <cffunction name="callbackThatReturnsFalse">
  17. <cfreturn false>
  18. </cffunction>
  19. <cffunction name="callbackThatReturnsTrue">
  20. <cfreturn true>
  21. </cffunction>
  22. <cffunction name="callbackThatReturnsNothing">
  23. </cffunction>
  24. <cffunction name="callbackThatSetsProperty">
  25. <cfset this.setByCallback = true>
  26. </cffunction>
  27. <cffunction name="firstCallback">
  28. <cfif NOT StructKeyExists(this, "orderTest")>
  29. <cfset this.orderTest = "">
  30. </cfif>
  31. <cfset this.orderTest = ListAppend(this.orderTest, "first")>
  32. </cffunction>
  33. <cffunction name="secondCallback">
  34. <cfif NOT StructKeyExists(this, "orderTest")>
  35. <cfset this.orderTest = "">
  36. </cfif>
  37. <cfset this.orderTest = ListAppend(this.orderTest, "second")>
  38. <cfreturn false>
  39. </cffunction>
  40. </cfcomponent>