Class: MetaConstructor

MetaConstructor

new MetaConstructor()

A model collection constructor
Source:

Extends

  • Array

Methods

addElement(element)

Adds a element to the collection
Parameters:
Name Type Description
element
Source:

addElements(elements)

Adds elements to the collection
Parameters:
Name Type Description
elements
Source:

clear()

Clears the collection
Source:

each(callback)

Iterates over each element of the collection
Parameters:
Name Type Description
callback function
Source:

getElement(id) → {Picasso.Model}

Gets a element of the collection
Parameters:
Name Type Description
id number
Source:
Returns:
Type
Picasso.Model

removeElement(id) → {Picasso.Model}

Removes a element from the collection
Parameters:
Name Type Description
id number
Source:
Returns:
Type
Picasso.Model

setCollectionType(ModelConstructor)

Sets the type of the collection
Parameters:
Name Type Description
ModelConstructor Picasso.Model
Source:

updateElement(element, property)

Update a element from collection
Parameters:
Name Type Argument Default Description
element Picasso.Model
property string <optional>
'id'
Source: