Changeset 325

Show
Ignore:
Timestamp:
7/8/2006 3:59:43 PM (3 years ago)
Author:
dhughes
Message:

Fixes #39, Fixes #40. Updated both these methods re the ticket.

Location:
trunk/reactor
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/reactor

    • Property svn:ignore
      •  

        old new  
        11project 
        22~tags 
         3debugMemory.cfm 
  • trunk/reactor/base/abstractRecord.cfc

    r320 r325  
    118118        <!--- delete ---> 
    119119        <cffunction name="delete" access="public" hint="I delete the record." output="false" returntype="void"> 
     120                <cfargument name="useTransaction" hint="I indicate if this delete should be executed within a transaction." required="no" type="boolean" default="true" /> 
     121                 
     122                <cfif arguments.useTransaction> 
     123                        <cfset deleteInTransaction() /> 
     124                <cfelse> 
     125                        <cfset executeDelete() /> 
     126                </cfif> 
     127                 
     128        </cffunction> 
     129         
     130        <!--- deleteInTransaction ---> 
     131        <cffunction name="deleteInTransaction" access="private" hint="I delete the record in a transaction." output="false" returntype="void"> 
     132                <cftransaction> 
     133                        <cfset executeDelete() /> 
     134                </cftransaction> 
     135        </cffunction> 
     136         
     137        <!--- executeDelete ---> 
     138        <cffunction name="executeDelete" access="private" hint="I actually delete the record." output="false" returntype="void"> 
    120139                <cfset beforeDelete() /> 
    121140                 
  • trunk/reactor/iterator/iterator.cfc

    r322 r325  
    6767                         
    6868                        <!--- get all the specified indexes and return them ---> 
    69                         <cfloop from="1" to="#ArrayLen(indexArray)#" index="x"> 
    70                                 <cfset ArrayAppend(Array, Records[indexArray[x]]) /> 
    71                         </cfloop> 
     69                         
     70                        <cfif ArrayLen(indexArray)> 
     71                                <cfloop from="1" to="#ArrayLen(indexArray)#" index="x"> 
     72                                        <cfset ArrayAppend(Array, Records[indexArray[x]]) /> 
     73                                </cfloop> 
     74                        </cfif> 
    7275                </cfif> 
    7376                 
     
    191194                         
    192195                        <!--- get all the specified indexes and return them ---> 
    193                         <cfloop from="1" to="#ArrayLen(indexArray)#" index="x"> 
    194                                 <!--- delete the record ---> 
    195                                 <cfset delete(indexArray[x]) /> 
    196                         </cfloop> 
     196                        <cfif ArrayLen(indexArray)> 
     197                                <cfloop from="1" to="#ArrayLen(indexArray)#" index="x"> 
     198                                        <!--- delete the record ---> 
     199                                        <cfset delete(indexArray[x]) /> 
     200                                </cfloop> 
     201                        </cfif> 
    197202                         
    198203                </cfif>