/*
Remove a model from the list
@model : model to remove
@options
357067
function(model, options) {
            // Define options
            options = _.defaults(options || {}, {
                silent: false,
                render: true
            });

            this.stopListening(model);

            if (this.items[model.id] == null) return this;

            this.items[model.id].remove();
            this.items[model.id] = null;
            delete this.items[model.id];

            if (!options.silent) this.trigger("remove", model);
            if (options.render) this.update();

            return this;
        }
540331
def remove(self, builder, model):
        
        column = model.get_qualified_deleted_at_column()

        query = builder.get_query()

        wheres = []
        for where in query.wheres:
            # If the where clause is a soft delete date constraint,
            # we will remove it from the query and reset the keys
            # on the wheres. This allows the developer to include
            # deleted model in a relationship result set that is lazy loaded.
            if not self._is_soft_delete_constraint(where, column):
                wheres.append(where)

        query.wheres = wheres
406685
public boolean remove(P model) {
        if (null == model) return false;
        boolean removed = false;
        if (presentationModels.containsValue(model)) {
            removePresentationModelByType(model);
            presentationModels.remove(model.getId());
            for (A attribute : model.getAttributes()) {
                removeAttributeById(attribute);
                removeAttributeByQualifier(attribute);
                attribute.removePropertyChangeListener(Attribute.QUALIFIER_NAME, ATTRIBUTE_WORKER);
            }
            fireModelStoreChangedEvent(model, ModelStoreEvent.Type.REMOVED);
            removed = true;
        }
        return removed;
    }
199685
function (req, res, options) {
    if (!options) {
      options = {};
    }
    options.operation = 'REMOVE';
    options.res = res;
    if (!options) {
      options = {};
    }
    if (req.params.model) {
      options.model = req.params.model;
    }
    if (req.params.query) {
      options.query = req.params.query;
    }
    if (req.params.id) {
      options.query = {
        _id: req.params.id,
      };
    }
    exports.remove.before(req, res, options);
    var userId = req.session['user-id'];
    vulpejs.models.remove({
      model: options.model,
      item: {
        _id: req.params.id,
      },
      query: options.query,
      validate: options.validate || false,
      userId: userId,
      callback: {
        success: function (item) {
          if (!vulpejs.utils.execute(options.callback, {
              item: item,
              res: res,
            })) {
            exports.remove.after(req, res, item);
            res.json({
              item: item,
            });
          }
        },
        error: function (error) {
          exports.response.error(options, error);
        },
        validate: function (validate) {
          exports.response.validate(options, validate);
        },
      },
    });
  }
135282
function(model) {
        var modelObj = model.changedAttributes();
        _.each(model.changed, function(value, key) {
          if (typeof value === 'undefined' || value === null) {
            if (key == 'id') {
              delete modelObj[key];
            } else {
              modelObj[key] = null;
            }
          }
        });

        return modelObj;
      }
635095
function(models, options) {
      var model, i, l, existing;
      var add = [], remove = [], modelMap = {};
      var idAttr = this.model.prototype.idAttribute;
      options = _.extend({add: true, merge: true, remove: true}, options);
      if (options.parse) models = this.parse(models);

      // Allow a single model (or no argument) to be passed.
      if (!_.isArray(models)) models = models ? [models] : [];

      // Proxy to `add` for this case, no need to iterate...
      if (options.add && !options.remove) return this.add(models, options);

      // Determine which models to add and merge, and which to remove.
      for (i = 0, l = models.length; i < l; i++) {
        model = models[i];
        existing = this.get(model.id || model.cid || model[idAttr]);
        if (options.remove && existing) modelMap[existing.cid] = true;
        if ((options.add && !existing) || (options.merge && existing)) {
          add.push(model);
        }
      }
      if (options.remove) {
        for (i = 0, l = this.models.length; i < l; i++) {
          model = this.models[i];
          if (!modelMap[model.cid]) remove.push(model);
        }
      }

      // Remove models (if applicable) before we add and merge the rest.
      if (remove.length) this.remove(remove, options);
      if (add.length) this.add(add, options);
      return this;
    }
483173
function (items, options) {
            var removed = [];

            if (!_.isArray(items)) {
                items = [items];
            }
            var item;
            for (var i = 0; i < items.length; i++) {
                item = this.removeAt(this.indexOf(items[i]), options);
                item && removed.push(item);
            }
            return removed;
        }
1188609
function(view, options) {
        options = _.extend({}, defaultOptions, defaultCallbacks, options);

        var model = options.model || view.model,
            collection = options.collection || view.collection;

        if(typeof model === 'undefined' && typeof collection === 'undefined'){
          throw 'Before you execute the binding your view must have a model or a collection.\n' +
                'See http://thedersen.com/projects/backbone-validation/#using-form-model-validation for more information.';
        }

        if(model) {
          bindModel(view, model, options);
        }
        else if(collection) {
          collection.each(function(model){
            bindModel(view, model, options);
          });
          collection.bind('add', collectionAdd, {view: view, options: options});
          collection.bind('remove', collectionRemove);
        }
      }
98
function () {
        var option = clone(this.option);

        each(option, function (opts, mainType) {
            if (ComponentModel.hasClass(mainType)) {
                var opts = modelUtil.normalizeToArray(opts);
                for (var i = opts.length - 1; i >= 0; i--) {
                    // Remove options with inner id.
                    if (modelUtil.isIdInner(opts[i])) {
                        opts.splice(i, 1);
                    }
                }
                option[mainType] = opts;
            }
        });

        delete option[OPTION_INNER_KEY];

        return option;
    }
808292
def delete(options = {})
      options = options.merge(option_group_name: @name)
      resp = @client.delete_option_group(options)
      resp.data
    end
709572
function(event, model, collection, options) {
            if ((event == 'add' || event == 'remove') && collection != this) return;
            if (event == 'destroy') {
                this.remove(model, options);
            }
            this.trigger.apply(this, arguments);
        }
720251
def delete_model(self, model_or_type, id_=None):
    
    if not id_:
      constraints = get_model_id_constraints(model_or_type)
    else:
      constraints = get_id_constraints(model_or_type.primary_key_name, id_)
    self.delete(model_or_type.table_name, constraints)

    return model_or_type
1180571
function remove(item, list) {
  var i = list.indexOf(item);
  if (~i) list.splice(i, 1);
}
283154
function remove(clientModelDoc, callback) {
      var cb = callback || angular.noop;

      return ClientModelDoc.remove({id: clientModelDoc._id},
        function (clientModelDoc) {
          return cb(clientModelDoc);
        },
        function (err) {
          return cb(err);
        }).$promise;
    }
1228211
function destroy(publicAPI, model = {}) {
  const previousDestroy = publicAPI.destroy;

  if (!model.subscriptions) {
    model.subscriptions = [];
  }

  publicAPI.destroy = () => {
    if (previousDestroy) {
      previousDestroy();
    }
    while (model.subscriptions && model.subscriptions.length) {
      model.subscriptions.pop().unsubscribe();
    }
    Object.keys(model).forEach((field) => {
      delete model[field];
    });

    // Flag the instance beeing deleted
    model.deleted = true;
  };
}
505759
def remove_core_element(self, model):
        
        assert model.scoped_variable.parent is self.model.state
        gui_helper_state_machine.delete_core_element_of_model(model)
606619
function removeThis()
    {
        $itemOptionList = eZProductCollectionItemOption::fetchList( $this->attribute( 'id' ) );

        $db = eZDB::instance();
        $db->begin();
        foreach( $itemOptionList as $itemOption )
        {
            $itemOption->remove();
        }
        $this->remove();
        $db->commit();
    }