new (require("baja/tag/RelationSet"))(relations)
Relations is used to store a collection of relation objects. A relations collection
is semantically equivalent to a mathematical set: it is an unordered collection of
distinct Relation objects.
Parameters:
Name | Type | Description |
---|---|---|
relations |
Array.<module:baja/tag/Relation> | An array of relation objects. |
Methods
-
get(id [, entityOrd])
-
Return a relation object for the specified id and entity.
Parameters:
Name Type Argument Description id
String | module:baja/tag/Id The id or qname of the
Relation.entityOrd
String | baja.Ord <optional>
The Entity ORD we're looking for.
If this isn't defined, the first matching relation with specified tag is
returned.Returns:
module:baja/tag/Relation The relation object or null
if the relation can't be found. -
getAll(id)
-
Return an array of all of the relations objects.
Parameters:
Name Type Description id
String | module:baja/tag/Id The id or qname of the
Relation. If not defined, the relations will be returned.Returns:
An array of Relations.
- Type
- Array.<module:baja/tag/Relation>
-
isEmpty()
-
Return true if there are no relation objects.
Returns:
- Type
- Boolean