Manual Reference Source Test
public class | source

ContentType

Expression Extends:

class ContentType extends aggregate(ContentTypeModel, Helper)

Helper class representing a Content Type.

Test:

Static Member Summary

Static Public Members
public static get

Constructor Summary

Public Constructor
public

Constructor for helper class representing a Content Type

Method Summary

Public Methods
public

async getAttributes(params: Object, options: String): Promise

Gets the attribute keys associated to this content type.

Static Public Members

public static get type: String source

Public Constructors

public constructor(json: Object) source

Constructor for helper class representing a Content Type

Params:

NameTypeAttributeDescription
json Object

json api response from server

Public Methods

public async getAttributes(params: Object, options: String): Promise source

Gets the attribute keys associated to this content type.

Params:

NameTypeAttributeDescription
params Object
  • optional

Parameters used to get information from server

params.id Number
  • optional

Id to get data from the server

params.filters Object
  • optional

Filters to be used for get

options String
  • optional

Modify the nature of the call and response

options.url String
  • optional

Override the url for this call

options.cacheMode String
  • optional

Override the caching method for this call

Return:

Promise

Promise with data (array or object)

Example:

import { ContentType, clinical6 } from 'clinical6';
const contentType = new ContentType({ id: 23 });
contentType.getAttributes({ id: 5 });
contentType.getAttributes({ filters: { member_type: 'patient' }});

// Combined with clinical6.get
clinical6.get(ContentType).then(contentType => { contentType[0].getAttributes() });

Test: