Class Index | File Index

## Classes

- _global_
- M
- M.ActionSheetDialogView
- M.AlertDialogView
- M.Application
- M.Base64
- M.ButtonGroupView
- M.ButtonView
- M.ConfirmDialogView
- M.ContainerView
- M.Controller
- M.Cypher
- M.DataProvider
- M.Date
- M.DateValidator
- M.EmailValidator
- M.Environment
- M.EventDispatcher
- M.FormView
- M.GridView
- M.I18N
- M.ImageView
- M.LabelView
- M.ListItemView
- M.ListView
- M.LoaderView
- M.LocalStorageProvider
- M.Logger
- M.Math
- M.Model
- M.ModelAttribute
- M.ModelRegistry
- M.NotMinusValidator
- M.NumberValidator
- M.Object
- M.Observable
- M.PageView
- M.PhoneValidator
- M.PresenceValidator
- M.RecordManager
- M.RemoteStorageProvider
- M.Request
- M.ScrollView
- M.SearchBarView
- M.SelectionListItemView
- M.SelectionListView
- M.SHA256
- M.TabBarItemView
- M.TabBarView
- M.TextFieldView
- M.ToggleView
- M.ToolbarView
- M.UrlValidator
- M.Validator
- M.View
- M.ViewManager
- M.WebSqlProvider

# Class M.ModelRegistry

Extends M.Object.
The root object for ModelRegistry. Model Registry is a central point for all models to get their Global Unique Identifier, which is important for storage (guid is primary key as default).
Defined in: model_registry.js.

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| M.ModelRegistry()

Field Summary
Field Attributes | Field Name and Description
--- | ---
| registry An array containing objects that save the model's name and their next GUId.
| type The type of this object.

Method Summary
Method Attributes | Method Name and Description
--- | ---
| getNextId(modelName) Calculates the next ID for a model named by modelName.
| register(modelName) Register a model in the registry.
| setId(modelName, id) Sets the id for a certain model.

Methods borrowed from class M.Object:
  bindToCaller, create, destroy, extend, get, include, set

Class Detail
M.ModelRegistry()
Field Detail
{Array|Object} registry
An array containing objects that save the model's name and their next GUId. Acts globally.

{String} type
The type of this object.
Method Detail
{Number} getNextId(modelName)
Calculates the next ID for a model named by modelName.

Parameters:
{String} modelName
  The name of the model, e.g. 'Person'.

Returns:
  {Number} The next internal model id for the model identified by modelName parameter.

register(modelName)
Register a model in the registry. Set nextGUId for this model to initial value 0.

Parameters:
{String} modelName
  The name of the model, e.g. 'Person'.

setId(modelName, id)
Sets the id for a certain model.

Parameters:
{String} modelName
  The name of the model, e.g. 'Person'.
{Number} id
  The id of the model, e.g. 1.

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Dec 08 2010 15:07:32 GMT+0100 (MEZ)