lib/Ext/util/AbstractMixedCollection.js
function(key, o){
        var me = this,
            old,
            index;

        if (arguments.length == 1) {
            o = arguments[0];
            key = me.getKey(o);
        }
        old = me.map[key];
        if (typeof key == 'undefined' || key === null || typeof old == 'undefined') {
             return me.add(key, o);
        }
        index = me.indexOfKey(key);
        me.items[index] = o;
        me.map[key] = o;
        me.fireEvent('replace', key, old, o);
        return o;
    }
function(key, o){
        var me = this,
            old,
            index;

        if (arguments.length == 1) {
            o = arguments[0];
            key = me.getKey(o);
        }
        old = me.map[key];
        if (typeof key == 'undefined' || key === null || typeof old == 'undefined') {
             return me.add(key, o);
        }
        index = me.indexOfKey(key);
        me.items[index] = o;
        me.map[key] = o;
        me.fireEvent('replace', key, old, o);
        return o;
    }
Replaces an item in the collection. Fires the {@link #event-replace} event when complete.
@param {String} key The key associated with the item to replace, or the replacement item.

If you supplied a {@link #getKey} implementation for this MixedCollection, or if the key
of your stored items is in a property called `id`, then the MixedCollection
will be able to _derive_ the key of the replacement item. If you want to replace an item
with one having the same key value, then just pass the replacement item in this parameter.
@param {Object} o (optional) If the first parameter passed was a key, the item to associate
with that key.
@return {Object}  The new item.