Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <cfcomponent
- name = "TestCom"
- output = "false"
- displayname = "Test component"
- >
- <!--- Init function --->
- <cffunction name="init" access="public" returnType="any" output="false" hint="Constructor">
- <!--- Vehicle categories --->
- <cfset Variables.VehicleCategories = {
- 'T1' : 'Beetle'
- , 'T1C' : 'Beetle Cabrio'
- , 'T2' : 'Type 2 Split'
- , 'T2B' : 'Type 2 Bay'
- , 'T25' : 'Type 25'
- , 'Ghia' : 'Karmann Ghia'
- , 'T3' : 'Type 3'
- , 'G1' : 'MK1 Golf'
- , 'G1C' : 'MK1 Golf Cabriolet'
- , 'CADDY' : 'MK1 Caddy'
- , 'G2' : 'MK2 Golf'
- , 'SC1' : 'MK1/2 Scirocco'
- , 'T4' : 'T4'
- , 'CO' : 'Corrado'
- , 'MISC' : 'MISC'
- } />
- <cfreturn this />
- </cffunction>
- <!--- Get category --->
- <cffunction name="getCategory" returntype="string" output="false">
- <cfargument name="vehicleID" required="true" type="string" hint="Vehicle type" />
- <cfscript>
- if (structKeyExists(Variables.VehicleCategories, Arguments.VehicleID)) {
- return Variables.VehicleCategories[Arguments.VehicleID];
- }
- else {
- return 'Base SKUs';
- }
- </cfscript>
- </cffunction>
- <!--- Get categories --->
- <cffunction name="getVehicleCategories" returntype="struct" output="false">
- <cfscript>
- return Variables.VehicleCategories;
- </cfscript>
- </cffunction>
- </cfcomponent>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement