-<!--- PUBLIC MODEL CLASS METHODS --->
-
-<cffunction name="findAll" returntype="any" access="public" output="false">
-	<cfargument name="where" type="string" required="false" default="">
-	<cfargument name="order" type="string" required="false">
-	<cfargument name="group" type="string" required="false">
-	<cfargument name="select" type="string" required="false" default="">
-	<cfargument name="distinct" type="boolean" required="false" default="false">
-	<cfargument name="include" type="string" required="false" default="">
-	<cfargument name="maxRows" type="numeric" required="false" default="-1">
-	<cfargument name="page" type="numeric" required="false" default="0">
-	<cfargument name="perPage" type="numeric" required="false">
-	<cfargument name="count" type="numeric" required="false" default="0">
-	<cfargument name="handle" type="string" required="false" default="query">
-	<cfargument name="cache" type="any" required="false" default="">
-	<cfargument name="reload" type="boolean" required="false">
-	<cfargument name="parameterize" type="any" required="false">
-	<cfargument name="returnAs" type="string" required="false">
-	<cfargument name="returnIncluded" type="boolean" required="false">
-	<cfargument name="callbacks" type="boolean" required="false" default="true">
-	<cfargument name="includeSoftDeletes" type="boolean" required="false" default="false">
-	<cfargument name="$limit" type="numeric" required="false" default="0">
-	<cfargument name="$offset" type="numeric" required="false" default="0">
-	<cfscript>
-		var loc = {};
+<cfscript>
+	/*
+	*  PUBLIC MODEL CLASS METHODS
+	*/
+	
+	public any function findAll(
+		string where="",
+		string order,
+		string group,
+		string select="",
+		boolean distinct="false",
+		string include="",
+		numeric maxRows="-1",
+		numeric page="0",
+		numeric perPage,
+		numeric count="0",
+		string handle="query",
+		any cache="",
+		boolean reload,
+		any parameterize,
+		string returnAs,
+		boolean returnIncluded,
+		boolean callbacks="true",
+		boolean includeSoftDeletes="false",
+		numeric $limit="0",
+		numeric $offset="0"
+	) { 
 		$args(name="findAll", args=arguments);
 		arguments.include = $listClean(arguments.include);
 		arguments.where = $cleanInList(arguments.where);

			arguments.perPage = 1;
			arguments.count = 1;
		}
		loc.rv = findAll(argumentCollection=arguments);
		if (IsArray(loc.rv))
		{
			if (ArrayLen(loc.rv))
			{
				loc.rv = loc.rv[1];
			}
			else
			{
				loc.rv = false;
			}
		}
	</cfscript>
	<cfreturn loc.rv>
</cffunction>

<cffunction name="findFirst" returntype="any" access="public" output="false">
	<cfargument name="property" type="string" required="false" default="#primaryKey()#">
	<cfargument name="$sort" type="string" required="false" default="ASC">
	<cfscript>
		var loc = {};
		$args(args=arguments, name="findFirst", combine="property/properties");
		arguments.order = "";
		loc.iEnd = ListLen(arguments.property);
		for (loc.i=1; loc.i <= loc.iEnd; loc.i++)
		{
			loc.item = ListGetAt(arguments.property, loc.i);
			arguments.order = ListAppend(arguments.order, loc.item & " " & arguments.$sort);
		}
		StructDelete(arguments, "property");
		StructDelete(arguments, "$sort");
		loc.rv = findOne(argumentCollection=arguments);
	</cfscript>
	<cfreturn loc.rv>
</cffunction>

<cffunction name="findLast" returntype="any" access="public" output="false">
	<cfargument name="property" type="string" required="false">
	<cfscript>
		var loc = {};
		arguments.$sort = "DESC";
		loc.rv = findFirst(argumentCollection=arguments);
	</cfscript>
	<cfreturn loc.rv>
</cffunction>

<cffunction name="findAllKeys" returntype="string" access="public" output="false">
	<cfargument name="quoted" type="boolean" required="false" default="false">
	<cfargument name="delimiter" type="string" required="false" default=",">
	<cfscript>
		var loc = {};
		loc.quoted = arguments.quoted;
		StructDelete(arguments, "quoted");
		loc.delimiter = arguments.delimiter;
		StructDelete(arguments, "delimiter");
		arguments.select = primaryKey();
		arguments.callbacks = false;
		loc.query = findAll(argumentCollection=arguments);
		if (loc.quoted)
		{
			loc.functionName = "QuotedValueList";
		}
		else
		{
			loc.functionName = "ValueList";
		}
		loc.rv = Evaluate("#loc.functionName#(loc.query.#arguments.select#, '#loc.delimiter#')");
	</cfscript>
	<cfreturn loc.rv>
</cffunction>

<!--- PUBLIC MODEL OBJECT METHODS --->

<cffunction name="reload" returntype="void" access="public" output="false">
	<cfscript>
		var loc = {};
		loc.query = findByKey(key=key(), reload=true, returnAs="query");
		loc.properties = propertyNames();
		loc.iEnd = ListLen(loc.properties);
		for (loc.i=1; loc.i <= loc.iEnd; loc.i++)
		{
			try
			{
				// coldfusion has a problem with blank boolean values in the query
				loc.property = ListGetAt(loc.properties, loc.i);
				this[loc.property] = loc.query[loc.property][1];
			}
			catch (any e)
			{
				this[loc.property] = "";
			}
		}
	</cfscript>
</cffunction>
		// convert primary key column name(s) / value(s) to a WHERE clause that is then used in the findOne call
		arguments.where = $keyWhereString(values=arguments.key);
		StructDelete(arguments, "key");
		local.rv = findOne(argumentCollection=arguments);
		return local.rv;
	}

	public any function findOne(
		string where="",
		string order="",
		string select="",
		string include="",
		any cache="",
		boolean reload,
		any parameterize,
		string returnAs,
		boolean includeSoftDeletes="false"
	) {
		$args(name="findOne", args=arguments);
		arguments.include = $listClean(arguments.include);
		if (!Len(arguments.include) || (StructKeyExists(variables.wheels.class.associations, arguments.include) && variables.wheels.class.associations[arguments.include].type != "hasMany"))
