lib/Ext/data/proxy/Proxy.js
function(options, /* deprecated */listeners) {
        var me = this,
            params = options.params,
            useBatch = me.getBatchActions(),
            model = me.getModel(),
            batch,
            records;

        if (options.operations === undefined) {
            // the old-style (operations, listeners) signature was called
            // so convert to the single options argument syntax
            options = {
                operations: options,
                listeners: listeners
            };

            // <debug warn>
            Ext.Logger.deprecate('Passes old-style signature to Proxy.batch (operations, listeners). Please convert to single options argument syntax.');
            // </debug>
        }

        if (options.batch && options.batch.isBatch) {
            batch = options.batch;
        } else {
            batch = new Ext.data.Batch(options.batch || {});
        }

        batch.setProxy(me);

        batch.on('complete', Ext.bind(me.onBatchComplete, me, [options], 0));
        if (options.listeners) {
            batch.on(options.listeners);
        }

        Ext.each(me.getBatchOrder().split(','), function(action) {
             records = options.operations[action];
             if (records) {
                 if (useBatch) {
                     var operationOptions = {
                         action: action,
                         records: records,
                         model: model
                     };
                     if (params) {
                         operationOptions.params = params;
                     }
                     batch.add(new Ext.data.Operation(operationOptions));
                 } else {
                     Ext.each(records, function(record) {
                         var operationOptions = {
                             action: action,
                             records: [record],
                             model: model
                         };
                         if (params) {
                             operationOptions.params = params;
                         }
                         batch.add(new Ext.data.Operation(operationOptions));
                     });
                 }
             }
        }, me);

        batch.start();
        return batch;
    }
function(options, /* deprecated */listeners) {
        var me = this,
            params = options.params,
            useBatch = me.getBatchActions(),
            model = me.getModel(),
            batch,
            records;

        if (options.operations === undefined) {
            // the old-style (operations, listeners) signature was called
            // so convert to the single options argument syntax
            options = {
                operations: options,
                listeners: listeners
            };

            // <debug warn>
            Ext.Logger.deprecate('Passes old-style signature to Proxy.batch (operations, listeners). Please convert to single options argument syntax.');
            // </debug>
        }

        if (options.batch && options.batch.isBatch) {
            batch = options.batch;
        } else {
            batch = new Ext.data.Batch(options.batch || {});
        }

        batch.setProxy(me);

        batch.on('complete', Ext.bind(me.onBatchComplete, me, [options], 0));
        if (options.listeners) {
            batch.on(options.listeners);
        }

        Ext.each(me.getBatchOrder().split(','), function(action) {
             records = options.operations[action];
             if (records) {
                 if (useBatch) {
                     var operationOptions = {
                         action: action,
                         records: records,
                         model: model
                     };
                     if (params) {
                         operationOptions.params = params;
                     }
                     batch.add(new Ext.data.Operation(operationOptions));
                 } else {
                     Ext.each(records, function(record) {
                         var operationOptions = {
                             action: action,
                             records: [record],
                             model: model
                         };
                         if (params) {
                             operationOptions.params = params;
                         }
                         batch.add(new Ext.data.Operation(operationOptions));
                     });
                 }
             }
        }, me);

        batch.start();
        return batch;
    }
Performs a batch of {@link Ext.data.Operation Operations}, in the order specified by {@link #batchOrder}. Used
internally by {@link Ext.data.Store}'s {@link Ext.data.Store#sync sync} method. Example usage:

myProxy.batch({
create : [myModel1, myModel2],
update : [myModel3],
destroy: [myModel4, myModel5]
});

Where the myModel* above are {@link Ext.data.Model Model} instances - in this case 1 and 2 are new instances and
have not been saved before, 3 has been saved previously but needs to be updated, and 4 and 5 have already been
saved but should now be destroyed.

@param {Object} options Object containing one or more properties supported by the batch method:

@param {Object} options.operations Object containing the Model instances to act upon, keyed by action name

@param {Object} [options.listeners] Event listeners object passed straight through to the Batch -
see {@link Ext.data.Batch} for details

@param {Ext.data.Batch/Object} [options.batch] A {@link Ext.data.Batch} object (or batch config to apply
to the created batch). If unspecified a default batch will be auto-created.

@param {Function} [options.callback] The function to be called upon completion of processing the batch.
The callback is called regardless of success or failure and is passed the following parameters:
@param {Ext.data.Batch} options.callback.batch The {@link Ext.data.Batch batch} that was processed,
containing all operations in their current state after processing
@param {Object} options.callback.options The options argument that was originally passed into batch

@param {Function} [options.success] The function to be called upon successful completion of the batch. The
success function is called only if no exceptions were reported in any operations. If one or more exceptions
occurred then the `failure` function will be called instead. The success function is called
with the following parameters:
@param {Ext.data.Batch} options.success.batch The {@link Ext.data.Batch batch} that was processed,
containing all operations in their current state after processing
@param {Object} options.success.options The options argument that was originally passed into batch

@param {Function} [options.failure] The function to be called upon unsuccessful completion of the batch. The
failure function is called when one or more operations returns an exception during processing (even if some
operations were also successful). The failure function is called with the following parameters:
@param {Ext.data.Batch} options.failure.batch The {@link Ext.data.Batch batch} that was processed,
containing all operations in their current state after processing
@param {Object} options.failure.options The options argument that was originally passed into batch

@param {Object} [options.scope] The scope in which to execute any callbacks (i.e. the `this` object inside
the callback, success and/or failure functions). Defaults to the proxy.

@param {Object} [options.params] External parameters for proxy fine tuning

@return {Ext.data.Batch} The newly created Batch