Home Manual Reference Source
public class | source

OrganisationProxy

Extends:

SimpleResourceProxy → OrganisationProxy

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public get

Returns parent instance

Method Summary

Public Methods
public

async attach(organisations: Array<Organisation|number>)

Attach organisations to the parent resource The provided organisations will be attached to the resource if they're not already attached

public

async attachAll()

Attach all organisations to the parent resource

public

async detach(organisations: Array<Organisation|number>)

Detach organisations from the parent resource The provided organisations will be detached from the resource

public

async detachAll()

Detach all organisations from the parent resource

public

async sync(organisations: Array<Organisation|number>)

Sync organisations to the parent resource The organisations attached to the target resource will be replaced with the organisations provided in the request.

Protected Methods
protected

async _modifyLink(items: Number, method: String, Type: function(new: ResourceBase), path: String)

Sync, attach or unlink resources

Inherited Summary

From class SimpleResourceProxy
public get

Target to wrap results in

public get

Get api instance

public get

Proxy target url

public

List target resource

public
this method was deprecated.

List target resource

public

Get the resource lister

public

Build a new instance of the target

Public Constructors

public constructor(api: Maps4News, parent: ResourceBase) source

Override:

SimpleResourceProxy#constructor

Params:

NameTypeAttributeDescription
api Maps4News

Instance of the api

parent ResourceBase

parent instance

Public Members

public get parent: ResourceBase: * source

Returns parent instance

Return:

ResourceBase

parent instance

Public Methods

public async attach(organisations: Array<Organisation|number>) source

Attach organisations to the parent resource The provided organisations will be attached to the resource if they're not already attached

Params:

NameTypeAttributeDescription
organisations Array<Organisation|number>

List of items to attach

Throw:

ApiError

public async attachAll() source

Attach all organisations to the parent resource

Throw:

ApiError

public async detach(organisations: Array<Organisation|number>) source

Detach organisations from the parent resource The provided organisations will be detached from the resource

Params:

NameTypeAttributeDescription
organisations Array<Organisation|number>

List of items to detach

Throw:

ApiError

public async detachAll() source

Detach all organisations from the parent resource

Throw:

ApiError

public async sync(organisations: Array<Organisation|number>) source

Sync organisations to the parent resource The organisations attached to the target resource will be replaced with the organisations provided in the request.

Params:

NameTypeAttributeDescription
organisations Array<Organisation|number>

List of items to sync

Throw:

ApiError

Protected Methods

Sync, attach or unlink resources

Params:

NameTypeAttributeDescription
items Number

List of items to sync or attach

method String

Http method to use

Type function(new: ResourceBase)

Resource type

path String
  • nullable: true

Optional appended resource path, will guess if null

Throw:

ApiError