OOPhoto - Almost An Object Oriented ColdFusion Application

<cffunction
	name="LoadObjectsFromQuery"
	access="private"
	returntype="array"
	output="false"
	hint="I take a query of comments and return an array of comment objects.">
 
	<!--- Define arguments. --->
	<cfargument
		name="Query"
		type="query"
		required="true"
		hint="I am a query of comments."
		/>
 
	<!--- Define the local scope. --->
	<cfset var LOCAL = {} />
 
	<!--- Return a return array. --->
	<cfset LOCAL.Return = [] />
 
	<!---
		Loop over the query and load a comment object
		for each record.
	--->
	<cfloop query="ARGUMENTS.Query">
 
		<!--- Load a new comment object. --->
		<cfset LOCAL.Comment = THIS.New() />
 
		<!--- Set the values from the query. --->
		<cfset LOCAL.Comment
			.SetID( ARGUMENTS.Query.id )
			.SetComment( ARGUMENTS.Query.comment )
			.SetDateCreated( ARGUMENTS.Query.date_created )
			.SetPhoto( VARIABLES.PhotoService.Load( ARGUMENTS.Query.photo_id ) )
			/>
 
		<!--- Add this comment to the return array. --->
		<cfset ArrayAppend(
			LOCAL.Return,
			LOCAL.Comment
			) />
 
	</cfloop>
 
	<!--- Return the array of comments. --->
	<cfreturn LOCAL.Return />
</cffunction>

For Cut-and-Paste