MCPcopy Create free account
hub / github.com/CloudBoost/cloudboost / relate

Method relate

sdk/src/CloudObject.js:44–60  ·  view source on GitHub ↗
(columnName, objectTableName, objectId)

Source from the content-addressed store, hash-verified

42 };
43
44 relate(columnName, objectTableName, objectId) { //for setting data for a particular column
45
46 var keywords = ['_tableName', '_type', 'operator'];
47
48 if (columnName === 'id' || columnName === '_id')
49 throw "You cannot set the id of a CloudObject";
50
51 if (columnName === 'id')
52 throw "You cannot link an object to this column";
53
54 if (keywords.indexOf(columnName) > -1) {
55 throw columnName + " is a keyword. Please choose a different column name.";
56 }
57
58 this.document[columnName] = new CB.CloudObject(objectTableName, objectId);
59 CB._modified(this, columnName);
60 };
61
62 get(columnName) { //for getting data of a particular column
63

Callers 2

test.jsFile · 0.80
test.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected