src/back/models/attributes/Attribute.js
function getDataName(adapterName) {
  expect(arguments).to.have.length.below(
    2,
    'Invalid arguments length when getting the data name of an Attribute ' +
    '(it has to be passed less than 2 arguments)');

  if (adapterName) {
    expect(adapterName).to.be.a(
      'string',
      'Invalid argument "adapterName" when getting the data name of an ' +
      'Attribute (it has to be a string)'
    );

    if (
      this.dataName &&
      typeof this.dataName === 'object' &&
      this.dataName.hasOwnProperty(adapterName)
    ) {
      return this.dataName[adapterName];
    }
  }

  if (this.dataName && typeof this.dataName === 'string') {
    return this.dataName;
  } else {
    return this.name;
  }
}
function getDataName(adapterName) {
  expect(arguments).to.have.length.below(
    2,
    'Invalid arguments length when getting the data name of an Attribute ' +
    '(it has to be passed less than 2 arguments)');

  if (adapterName) {
    expect(adapterName).to.be.a(
      'string',
      'Invalid argument "adapterName" when getting the data name of an ' +
      'Attribute (it has to be a string)'
    );

    if (
      this.dataName &&
      typeof this.dataName === 'object' &&
      this.dataName.hasOwnProperty(adapterName)
    ) {
      return this.dataName[adapterName];
    }
  }

  if (this.dataName && typeof this.dataName === 'string') {
    return this.dataName;
  } else {
    return this.name;
  }
}
function getDataName ( adapterName ) { expect ( arguments ) . to . have . length . below ( 2 , 'Invalid arguments length when getting the data name of an Attribute ' + '(it has to be passed less than 2 arguments)' ) ; if ( adapterName ) { expect ( adapterName ) . to . be . a ( 'string' , 'Invalid argument "adapterName" when getting the data name of an ' + 'Attribute (it has to be a string)' ) ; if ( this . dataName && typeof this . dataName === 'object' && this . dataName . hasOwnProperty ( adapterName ) ) { return this . dataName [ adapterName ] ; } } if ( this . dataName && typeof this . dataName === 'string' ) { return this . dataName ; } else { return this . name ; } }
Gets the data name of an Entity attribute to be used in an adapter.
@name module:back4app-entity/models/attributes.Attribute#getDataName
@function
@param {?string} [adapterName] The name of the adapter of which the data
name is wanted.
@returns {string} The data name.
@example
var dataName = MyEntity.attributes.myAttribute.getDataName('default');
Gets the data name of an Entity attribute to be used in an adapter .