Show:

Users.User Class

Extends Base.Users.User
Module: Users

Class representing 'User' rows in the 'Users' database

Constructor

Users.User

(
  • fields
)

Parameters:

  • fields Object

    The fields values to initialize table row as an associative array of {column: value} pairs

Item Index

Methods

Methods

clientsOnline

(
  • userId
  • [sessionId]
)
Object static

Get all the socket clients that a user has online

Parameters:

  • userId String

    The id of a user

  • [sessionId] String optional

    Optionally provide a session id, to filter clients by

Returns:

Object:

Contains {clientId: client} pairs

devices

(
  • userId
  • appIds
  • callback
)
static

Gets an array of all devices associated with userId and passes it to callback. Data is filtered for platforms listed in config array {App}/cordova/platforms

Parameters:

  • userId String

    The id of a user

  • appIds Object

    An object of {platform: appIds} pairs, where keys are the names of a platform in "Users"/"apps"/"platforms" array, and values are a string or array with the external app id registered with the platform.

  • callback Function

    The first parameter contains {platformName: devicesArray}

(
  • [size=40]
)
String

Calculate the url of a user's icon

Parameters:

  • [size=40] Number optional

    the size of the icon to render.

Returns:

String:

the url

setUp

()

The setUp() method is called the first time an object of this class is constructed.