<cffunction
name="LoadObjectsFromQuery"
access="private"
returntype="array"
output="false"
hint="I take a query of comments and return an array of comment objects.">
<cfargument
name="Query"
type="query"
required="true"
hint="I am a query of comments."
/>
<cfset var LOCAL = {} />
<cfset LOCAL.Return = [] />
<cfloop query="ARGUMENTS.Query">
<cfset LOCAL.Comment = THIS.New() />
<cfset LOCAL.Comment
.SetID( ARGUMENTS.Query.id )
.SetComment( ARGUMENTS.Query.comment )
.SetDateCreated( ARGUMENTS.Query.date_created )
.SetPhoto( VARIABLES.PhotoService.Load( ARGUMENTS.Query.photo_id ) )
/>
<cfset ArrayAppend(
LOCAL.Return,
LOCAL.Comment
) />
</cfloop>
<cfreturn LOCAL.Return />
</cffunction>