OOPhoto - Almost An Object Oriented ColdFusion Application

<cffunction
	name="Load"
	access="public"
	returntype="any"
	output="false"
	hint="I load and return a comment object based on the given ID. If no comment is found, throws an exception.">
 
	<!--- Define arguments. --->
	<cfargument
		name="ID"
		type="numeric"
		required="true"
		hint="I am the ID of the given comment."
		/>
 
	<!--- Define the local scope. --->
	<cfset var LOCAL = {} />
 
	<!--- Query for the comment. --->
	<cfquery name="LOCAL.CommentData" datasource="#VARIABLES.DSN.Source#">
		SELECT
			c.id,
			c.comment,
			c.date_created,
			c.photo_id
		FROM
			comment c
		INNER JOIN
			photo p
		ON
			(
					c.photo_id = p.id
				AND
					p.id = <cfqueryparam
								value="#ARGUMENTS.ID#"
								cfsqltype="cf_sql_integer"
								/>
			)
		ORDER BY
			c.date_created ASC
	</cfquery>
 
	<!---
		Check to see if a record was found. If so, return the
		loaded object, else throw an exception.
	--->
	<cfif LOCAL.CommentData.RecordCount>
 
		<!--- Load the object from the given query. --->
		<cfset LOCAL.Comments =
			VARIABLES.LoadObjectsFromQuery(
				LOCAL.CommentData
			) />
 
		<!--- Return the first object. --->
		<cfreturn LOCAL.Comments[ 1 ] />
 
	<cfelse>
 
		<!--- Throw exception. --->
		<cfthrow
			type="OOPhoto.InvalidComment"
			message="The selected comment could not be found."
			detail="The comment with ID #ARGUMENTS.ID# could not be found."
			/>
 
	</cfif>
</cffunction>

For Cut-and-Paste