src/back/models/EntitySpecification.js
function addAttribute() {
    var attribute =
      arguments.length === 1 && arguments[0] instanceof attributes.Attribute ?
        arguments[0] :
        attributes.Attribute.resolve.apply(
          null,
          Array.prototype.slice.call(arguments)
        );

    var newAttributes = attributes.AttributeDictionary.concat(
      _attributes,
      attribute
    );

    if (_Entity) {
      _loadEntityAttribute(attribute);
    }

    _attributes = newAttributes;
  }
function addAttribute() {
    var attribute =
      arguments.length === 1 && arguments[0] instanceof attributes.Attribute ?
        arguments[0] :
        attributes.Attribute.resolve.apply(
          null,
          Array.prototype.slice.call(arguments)
        );

    var newAttributes = attributes.AttributeDictionary.concat(
      _attributes,
      attribute
    );

    if (_Entity) {
      _loadEntityAttribute(attribute);
    }

    _attributes = newAttributes;
  }
function addAttribute ( ) { var attribute = arguments . length === 1 && arguments [ 0 ] instanceof attributes . Attribute ? arguments [ 0 ] : attributes . Attribute . resolve . apply ( null , Array . prototype . slice . call ( arguments ) ) ; var newAttributes = attributes . AttributeDictionary . concat ( _attributes , attribute ) ; if ( _Entity ) { _loadEntityAttribute ( attribute ) ; } _attributes = newAttributes ; }
Adds a new attribute to the attributes in the specification.
@name module:back4app-entity/models.EntitySpecification#addAttribute
@function
@param {!module:back4app-entity/models/attributes.Attribute} attribute This
is the attribute to be added. It can be passed as a
{@link module:back4app-entity/models/attributes.Attribute} instance.
@param {?string} [name] This is the name of the attribute.
@example
entitySpecification.addAttribute(
new StringAttribute('attribute'),
'attribute'
);
 
Adds a new attribute to the attributes in the specification
@name module:back4app-entity/models.EntitySpecification#addAttribute
@function
@param {!Object} attribute This is the attribute to be added. It can be
passed as an Object, as specified in
{@link module:back4app-entity/models/attributes.Attribute}.
@param {!string} [attribute.name] It is the name of the attribute. It is
optional if it is passed as an argument in the function.
@param {!string} [attribute.type='Object'] It is the type of the attribute.
It is optional and if not passed it will assume 'Object' as the default
value.
@param {!string} [attribute.multiplicity='1'] It is the multiplicity of the
attribute. It is optional and if not passed it will assume '1' as the
default value.
@param {?(boolean|number|string|Object|function)} [attribute.default] It is
the default expression of the attribute.
@param {?string} [name] This is the name of the attribute.
@example
entitySpecification.addAttribute({
name: 'attribute',
type: 'string',
multiplicity: '0..1',
default: 'default'
}, 'attribute');
 
Adds a new attribute to the attributes in the specification.
@name module:back4app-entity/models.EntitySpecification#addAttribute
@function
@param {!string} name It is the name of the attribute.
@param {!string} [type='Object'] It is the type of the attribute. It is
optional and if not passed it will assume 'Object' as the default value.
@param {!string} [multiplicity='1'] It is the multiplicity of the
attribute. It is optional and if not passed it will assume '1' as the
default value.
@param {?(boolean|number|string|Object|function)} [default] It is the
default expression of the attribute.
@example
entitySpecification.addAttribute(
'attribute',
'string',
'0..1',
'default'
);
Adds a new attribute to the attributes in the specification .