Manual Reference Source Test
public class | source

PlatformMenu

Mixin Extends:

PlatformMenuModel, Helper

Helper class representing an platformMenu.

Example:

import { PlatformMenu, platformMenuService } from 'clinical6';

// Typically use PlatformMenuService.get()
platformMenuService.get().then(platformMenus => console.log(platformMenus));

const platformMenu = new PlatformMenu({
 "data": {
   "id": "319",
   "type": "menus",
   "attributes": {
     "icon": "icon-star",
     "title": "vitae",
     "position": 1,
     "enabled": true,
     "url": "#",
     "access_class": null,
   },
   "relationships": {
     "parent": {
       "data": null
     },
     "children": {
       "data": []
     },
     "authorizable": {
"data": null
}
   }
 }
});

Test:

Static Member Summary

Static Public Members
public static get

Constructor Summary

Public Constructor
public

Constructor for helper class representing an PlatformMenu

Member Summary

Public Members
public get

authorizable: Section | Flow | Content

public set

authorizable: Section | Flow | Content

public get
public set
public get
public set

Method Summary

Public Methods
public

Saves a platformMenu (insert if id doesn't exist, update if it does)

public

Saves a platformMenu (insert if id doesn't exist, update if it does)

Inherited Summary

From class PlatformMenuModel
public
public
public
public
public
public
public

Static Public Members

public static get type: String source

Public Constructors

public constructor(json: Object) source

Constructor for helper class representing an PlatformMenu

Override:

PlatformMenuModel#constructor

Params:

NameTypeAttributeDescription
json Object

json api response from server

Public Members

public get authorizable: Section | Flow | Content source

public set authorizable: Section | Flow | Content source

public get children: PlatformMenu[] source

public set children: PlatformMenu[] source

public get parent: PlatformMenu source

public set parent: PlatformMenu source

Public Methods

public delete(): Promise source

Saves a platformMenu (insert if id doesn't exist, update if it does)

Return:

Promise

Returns a promise via ajax call.

Example:

import { PlatformMenu, Client } from 'clinical6';

// Removes platformMenu from server and local storage
const platformMenu = new PlatformMenu({
 "data": {
   "id": "319",
   "type": "menus",
   "attributes": {
     "icon": "icon-star",
     "title": "vitae",
     "position": 1,
     "enabled": true,
     "url": "#"
   },
   "relationships": {
     "parent": {
       "data": null
     },
     "children": {
       "data": []
     },
     "authorizable": {
       "data": null
    }
   }
 }
});
platformMenu.delete();

// No longer in storage
Client.instance.storageUtility.has('platformMenus', { id: 1 });

Test:

public save(): Promise<PlatformMenu> source

Saves a platformMenu (insert if id doesn't exist, update if it does)

Return:

Promise<PlatformMenu>

Returns a promise via ajax call.

Example:

import { PlatformMenu, platformMenuService } from 'clinical6';

// Insert is different from other inserts.  Uses mobile application key
const platformMenu = new PlatformMenu({
  "title": "My Favorite Menu"
});
platformMenu.save();

// After you have the authtoken and then you've logged in

// Updates existing platformMenu (has existing id)
platformMenuService.get().then(platformMenus => platformMenus[0].save());

Test: