Advertisement
Guest User

Untitled

a guest
Jun 6th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <cfcomponent displayname="FulfillmentXMLImportService"
  2.              extends="ORMService"
  3.              output="false">
  4.  
  5.     <cffunction name="init" returntype="any">
  6.        
  7.         <cfscript>
  8.             super.init(argumentCollection=arguments);
  9.             return this;
  10.         </cfscript>
  11.  
  12.     </cffunction>
  13.    
  14.     <cffunction name="save" returntype="void">
  15.         <cfargument name="entity" type="any" />
  16.        
  17.         <cfscript>
  18.             var compositeFilter = {username = arguments.entity.getUsername(),
  19.                                    password = arguments.entity.getPassword()};
  20.                                    
  21.             var compositeResults = super.load(filter=compositeFilter);
  22.            
  23.             if(arrayLen(compositeResults))
  24.             {
  25.                 throw(message="Username/password combination already exists");
  26.             }
  27.             else
  28.             {
  29.                 super.save(arguments.entity);
  30.             }
  31.         </cfscript>
  32.  
  33.     </cffunction>
  34.  
  35. </cfcomponent>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement