Class Index | File Index

Classes


Class Trust

The class accepts a pre-defined set of Trust attributes, four of them are required: Name, Authority, CustomerId, Type, the ID will be generated automatically; The Description and SourceTrustID are optional.


Defined in: trust.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Trust(properties)
Constructs an instance of the Trust class based on passed-in properties.
Method Summary
Method Attributes Method Name and Description
 
Deletes an existing trust.
<static>  
Trust.find(params)
Finds the trust(s) with the same attributes as the passed-in filter.
 
Retrieves all the accounts that are currently associated with this trust.
 
Checks whether a trust object is current or not.
<static>  
Trust.isSupported()
Checks whether the Trust API is supported or not.
 
save()
The save methods saves the trust object synchronously.
Class Detail
Trust(properties)
Constructs an instance of the Trust class based on passed-in properties.
Parameters:
{Hash} properties
Initial properties (JSON notation) to define trust
Method Detail
elide()
Deletes an existing trust. The actual trust object is never physically deleted from the database, it is actually flagged as not-current in the system. After it's deleted, a trust can not be associated with an account any more.

<static> {Trust[]} Trust.find(params)
Finds the trust(s) with the same attributes as the passed-in filter. All attributes are matched as with an AND operator. You can pass in a string in JSON notation or a prototype Trust object.

Example:

var myTrusts = Trust.find({Name: "Developer"});
Parameters:
{JSON} params
notation of the trust attributes
Throws:
{String}
Throws an string exception describing the error.
Returns:
{Trust[]} Returns an array of Trusts found. Only trusts that are currently active will be returned. The array could be of size 0 if no trusts match the search criteria.

{Account[]} getAccounts()
Retrieves all the accounts that are currently associated with this trust. If no accounts are attached, an empty array ([]) will be returned.
Returns:
{Account[]} Returns an array of accounts.

{Boolean} isCurrent()
Checks whether a trust object is current or not.
Returns:
{Boolean} returns true when the trust is current.

<static> {Boolean} Trust.isSupported()
Checks whether the Trust API is supported or not.
Returns:
{Boolean}

{Boolan} save()
The save methods saves the trust object synchronously.

Example:

var trust1 = new Trust({
				Name:"Developer", 
				Authority:"SAP", 
				Description:"SAP Role", 
				Type:"Role", 
				CustomerId:"345"
				});
trust1.save();
Throws:
{String}
Throws an string exception describing the error.
Returns:
{Boolan} Result

©2008
Documentation generated by JsDoc Toolkit 2.0.2 on Thu Oct 07 2010 07:23:18 GMT-0400 (EDT)