getLocalTableId
The getLocalTableId
method returns the Id
of the underlying local Table
that is used in the Relationship
.
getLocalTableId(relationshipId: Id): any
Type | Description | |
---|---|---|
relationshipId | Id | The |
returns | any | The |
If the Relationship
Id
is invalid, the method returns undefined
.
Example
This example creates a Relationship
object, a single Relationship
definition, and then queries it (and a non-existent definition) to get the underlying local Table
Id
.
const relationships = createRelationships(createStore());
relationships.setRelationshipDefinition(
'petSpecies',
'pets',
'species',
'species',
);
console.log(relationships.getLocalTableId('petSpecies'));
// -> 'pets'
console.log(relationships.getLocalTableId('petColor'));
// -> undefined