src/back/models/Entity.js
function (CurrentEntity) {
  return function (entity) {
    expect(arguments).to.have.length.below(
      2,
      'Invalid arguments length when creating a new Entity function (it has ' +
      'to be passed less than 2 arguments)'
    );

    return function (attributeValues) {
      expect(arguments).to.have.length.below(
        2,
        'Invalid arguments length when creating a new Entity (it has ' +
        'not to be passed less than 2 arguments)'
      );

      var EntityClass = CurrentEntity;

      if (entity) {
        EntityClass = Entity.getSpecialization(entity);
      }

      return new EntityClass(attributeValues);
    };
  };
}
function (CurrentEntity) {
  return function (entity) {
    expect(arguments).to.have.length.below(
      2,
      'Invalid arguments length when creating a new Entity function (it has ' +
      'to be passed less than 2 arguments)'
    );

    return function (attributeValues) {
      expect(arguments).to.have.length.below(
        2,
        'Invalid arguments length when creating a new Entity (it has ' +
        'not to be passed less than 2 arguments)'
      );

      var EntityClass = CurrentEntity;

      if (entity) {
        EntityClass = Entity.getSpecialization(entity);
      }

      return new EntityClass(attributeValues);
    };
  };
}
function ( CurrentEntity ) { return function ( entity ) { expect ( arguments ) . to . have . length . below ( 2 , 'Invalid arguments length when creating a new Entity function (it has ' + 'to be passed less than 2 arguments)' ) ; return function ( attributeValues ) { expect ( arguments ) . to . have . length . below ( 2 , 'Invalid arguments length when creating a new Entity (it has ' + 'not to be passed less than 2 arguments)' ) ; var EntityClass = CurrentEntity ; if ( entity ) { EntityClass = Entity . getSpecialization ( entity ) ; } return new EntityClass ( attributeValues ) ; } ; } ; }
Private function used to get the new function specific for the current Entity
class.
@name module:back4app-entity/models.Entity~_getNewFunction
@function
@param {!Class} CurrentEntity The current entity class for which the new
function will be created.
@returns {function} The new function.
@private
@example
Entity.new = _getNewFunction(Entity);
Private function used to get the new function specific for the current Entity class .