new (require("baja/tag/SmartRelation"))(directRelations, impliedRelations)
SmartRelations holds a collection of both direct and implemented
module:baja/tag/Relation objects.
Parameters:
Name | Type | Description |
---|---|---|
directRelations |
A direct Relations implementation. |
|
impliedRelations |
An implied Relations implementation. |
Methods
-
get(id [, entityOrd])
-
Find the specified Relation object via its Id and return it.
If the Relation can't be found then return null.Parameters:
Name Type Argument Description id
String | module:baja/tag/Id The Id
used for the search. This can be an Id or a qname for an Id.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:
The Relation object
or null if nothing can be found. -
getAll()
-
Returns a copy of the contained Relations array.
Any duplicate relations are filtered out.
Returns:
An array of Relation objects.
- Type
- Array.<module:baja/tag/Relation>
-
getDirectRelations()
-
Return the direct relations.
Returns:
The direct Relations.
-
getImpliedRelations()
-
Return the implied relations.
Returns:
the implied relations.
-
isEmpty()
-
Returns:
Returns true if there are no Relation objects.
- Type
- Boolean