getDocumentURL ( ) { String }

If this is a document record, this function returns the URL to the file pointed to by this record.

getDownloadURL ( ) { String }

If this is a document record, this function returns the download URL

getId ( ) { ID }

Returns the record's ID.

Returns

The ID of the record.

getModel ( ) { Model }

Returns the record's model

getThumbnailURL ( format: String ) { String }

TODO

Parameters
Name Type Description
format String

format

getURL ( ) { String }

TODO

load ( ) { Promise }

Download the contents of this document

loadRelations ( relations: String , opts: Object ) { Promise }

Loads related records

Parameters
Name Type Description
relations String

Comma-separated list of relation-paths to load

opts Object

options

remove ( opts: Object )

Removes a record from the database.

Parameters
Name Type Description
opts Object

Configuration object

Properties
Name Type Description
onSuccess Function Callback when the operation was successful.
onError Function Callback when the operation resulted in an error.

save ( )

Saves this record

sync ( opts: Object ) { Promise }

Synchronize this record. The record is transferred to the backend and deleted from the offline-storage.

Parameters
Name Type Description
opts Object

options

toJSON ( ) { String }

Creates a JSON string from the record.

Returns

The record in JSON format.

_clone ( ) { Record }

Clones the record

Returns

A clone of the record (with the ID removed).

_getAttributeValue ( name: String ) { Object }

Returns the value of the specified attribute.

Parameters
Name Type Description
name String

The name of the attribute.

Returns

The attribute's value.

_getMetadata ( ) { Object }

Returns the records metadata, if available

_hasPrivilege ( privilege: String ) { boolean }

Checks whether the user has a certain privilege on this record. If privileges are not loaded this method will return undefined.

Parameters
Name Type Description
privilege String

privilege

_isNew ( ) { Boolean }

Returns true if the record is a new record (has no ID yet).

_setMetadata ( metadata: Object )

Set the records metadata

Parameters
Name Type Description
metadata Object

metadata Metadata properties