Class: Data/Bean

Data/Bean


new Data/Bean()

Base bean class. Beans extend Backbone.Model.

Use Data.DataManager to create instances of beans.

CRUD

Use standard Backbone's fetch, save, and destroy methods to perform CRUD operations on beans. See the Data.DataManager class for details.

Validation

This class does not override Backbone.Model.validate. The validation is done in the save method. If the bean is invalid the save is rejected. Use Data/Bean#isValidAsync to check if the bean is valid in other situations. Failed validations trigger an app:error:validation:<field-name> event.

Members


_defaults :Object

The hash of field names and default values.

This hash should be used instead of the Backbone.Model#default property. Setting default values is done in Data/Bean#initialize only if the given model is new.

Type:
  • Object

<readonly> fields :Object

The list of fields and their vardefs.

Type:
  • Object

Relationship link information.

{
    name: link name,
    bean: reference to the related bean
    isNew: flag indicating that it is a new relationship
}

The link.isNew flag is used to distinguish between an existing relationship and a relationship that is about to be created. Please refer to REST API specification for details. In brief, REST API