OOPhoto - No More Validation In The Controller

<cffunction
	name="Save"
	access="public"
	returntype="any"
	output="false"
	hint="I take a photo gallery object and persist it (using a database transaction).">
 
	<!--- Define arguments. --->
	<cfargument
		name="Gallery"
		type="any"
		required="true"
		hint="I am the photo gallery object to be persisted."
		/>
 
	<!--- Define the local scope. --->
	<cfset var LOCAL = {} />
 
 
	<!---
		Before we save the object, let's run validation one
		more time to make sure that the incoming bean actually
		contains valid data.
	--->
	<cfif StructCount( THIS.Validate( ARGUMENTS.Gallery ) )>
 
		<!--- Throw exception. --->
		<cfthrow
			type="OOPhoto.InvalidData"
			message="The selected photo gallery contains invalid data."
			detail="The photo gallery with ID #ARGUMENTS.Gallery.GetID()# contains invalid data for persisting."
			/>
 
	</cfif>
 
	......CODE........
 
</cffunction>

For Cut-and-Paste