variables.GettableProperties = arguments.GettableProperties; variables.SettableProperties = arguments.SettableProperties; variables.GettableClassProperties = arguments.GettableClassProperties; variables.SettableClassProperties = arguments.SettableClassProperties; variables.IteratorRecord = 0; variables.NumberofRecords = 0; // Create a structure for storing data values within the object variables.Data = StructNew(); variables.Data.Instance = StructNew(); variables.Data.Class = StructNew(); variables.Data.Instance[0] = StructNew(); // Super.Init(argumentsCollection=Arguments); variables.FailQuietlyonGet = true; IteratorRecord = NumberofRecords + 1; NumberofRecords = NumberofRecords + 1; variables.Data.Instance[IteratorRecord] = StructNew(); var ReturnValue = ""; If (ListFindNoCase(GettableClassProperties, PropertyName) OR GettableClassProperties EQ "*") { If (StructKeyExists(variables, "classget#PropertyName#")) { // Custom getter exists - run it ReturnValue = evaluate("variables.classget#PropertyName#()"); } Else { If (StructKeyExists(variables.Data.Class, PropertyName)) { // Value exists, return it ReturnValue = variables.Data.Class[PropertyName]; } Else {invalidAccess("classget", PropertyName, "It doesn't exist");}; }; } Else {invalidAccess("classget", PropertyName, "It isn't gettable (not included in GettableClassProperties - #GettableClassProperties#)).");}; var ReturnValue = false; If (ListFindNoCase(SettableClassProperties, PropertyName) OR SettableClassProperties EQ "*") { If (StructKeyExists(variables, "classset#PropertyName#")) { // Custom setter exists - run it ReturnValue = evaluate("variables.classset#PropertyName#(PropertyValue)"); } Else { variables.Data.Class[PropertyName] = PropertyValue; ReturnValue = true; }; } Else { invalidAccess("classset", PropertyName, "It isn't settable (not included in SettableClassProperties - #SettableClassProperties#)))."); }; var ReturnValue = ""; if(NOT Len(PropertyName)){ return variables.Data.Instance[IteratorRecord]; } If (ListFindNoCase(GettableProperties, PropertyName) OR GettableProperties EQ "*") { If (StructKeyExists(variables, "get#PropertyName#")) { // Custom getter exists - run it ReturnValue = evaluate("variables.get#PropertyName#()"); } Else { If (StructKeyExists(variables.Data.Instance[IteratorRecord], PropertyName)) { // Value exists, return it ReturnValue = variables.Data.Instance[IteratorRecord][PropertyName]; } Else { If(NOT FailQuietlyonGet) {invalidAccess("get", PropertyName, "It doesn't exist in instance #IteratorRecord#.");}; }; }; } Else {invalidAccess("get", PropertyName, "It isn't gettable (not included in GettableProperties - #GettableProperties#).");}; var theQuery = arguments.Recordset; var theStructure = StructNew(); var cols = ListToArray(theQuery.columnlist); var row = 1; var thisRow = ""; var col = 1; If (theQuery.recordcount LT 1) { theStructure[row] = StructNew(); THIS.Recordset = theStructure[row]; } Else { for(row = 1; row LTE theQuery.recordcount; row = row + 1) { thisRow = StructNew(); for(col = 1; col LTE arraylen(cols); col = col + 1) { thisRow[cols[col]] = theQuery[cols[col]][row]; } theStructure[row] = Duplicate(thisRow); THIS.Recordset = arguments.Recordset; } }; if(Len(arguments.ComponentType)){ variables.ComponentType = arguments.ComponentType; } variables.Data.Instance = theStructure; variables.NumberofRecords = theQuery.recordcount; variables.IteratorRecord = 1; variables.ImportedPropertyNameList = theQuery.columnlist; var KeyWithoutPrefix = ""; var PrefixLength = Len(Prefix); For (key in arguments.Structure) { If (Len(Prefix) GT 0) { If (Left(Key, PrefixLength) EQ Prefix) KeyWithoutPrefix = Right(Key, (Len(Key) - PrefixLength)); If (Override OR NOT StructKeyExists(variables.Data.Instance[IteratorRecord], KeyWithoutPrefix)) {variables.Data.Instance[IteratorRecord][KeyWithoutPrefix] = arguments.Structure[key];}; } Else { If (Override OR NOT StructKeyExists(variables.Data.Instance[IteratorRecord], key)) {variables.Data.Instance[IteratorRecord][key] = arguments.Structure[key];}; }; }; variables.NumberofRecords = ArrayLen(arguments.ArrayItem); variables.IteratorRecord = 1; variables.Data.instance = arguments.ArrayItem; variables.ImporedPropertyNameList = ""; var ReturnValue = "true"; If (IteratorRecord GTE NumberofRecords) { ReturnValue = False; IteratorRecord = NumberofRecords; } Else {IteratorRecord = IteratorRecord + 1;}; var ReturnValue = "true"; If (IteratorRecord GTE NumberofRecords) { ReturnValue = False; } var ReturnValue = false; If (ListFindNoCase(SettableProperties, PropertyName) OR SettableProperties EQ "*") { If (StructKeyExists(variables, "set#PropertyName#")) { // Custom setter exists - run it ReturnValue = evaluate("variables.set#PropertyName#(PropertyValue)"); } Else { variables.Data.Instance[IteratorRecord][PropertyName] = PropertyValue; ReturnValue = true; }; } Else { invalidAccess("set", PropertyName, "It isn't settable (not included in SettableProperties - #SettableProperties#))"); };