new Related(rel [, direction])
Creates a Related transformer.
Parameters:
| Name | Type | Argument | Default | Description |
|---|---|---|---|---|
rel |
olympe.dc.Tag | Tag of the relation. |
||
direction |
olympe.dc.Direction |
<optional> |
olympe.dc.Direction.DESTINATION | Direction for the relation. |
- Implements:
Methods
-
<package, static> makeIndex(parentIndex, relationDirection, relationTag, relatedTag)
-
Computes an index value for a related instance
Parameters:
Name Type Description parentIndexstring Parent instance index value
relationDirectionstring Relation direction
relationTagstring Relation tag
relatedTagstring Related instance tag
Returns:
The calculated index.
- Type
- string
-
getInverse()
-
-
getName()
-
Gets this
Transformerunique name.- Implements:
Returns:
The name.
- Type
- string
-
getTransform(manager, stateResolver, callback)
-
Get the transformer's transform function. This is the method that implementations of
Transformermust provide and is where the actual transformation will take place.Parameters:
Name Type Description managerolympe.dc.Manager The DC manager.
stateResolverolympe.dc.ranking.StateResolver The state resolver.
callbackolympe.dc.Manager.TransformationCallback The callback.
- Implements:
Returns:
The transform function.
-
getValueType()
-
Gets the transformed item's value type. A
nullvalue means that the transformer will not change the type of the values (e.g. a sort transformer).- Implements:
Returns:
Returns the transformed listDef value new type or
nullif this transformer does not change it- Type
- function
-
serialize(parameters)
-
Serializes the transformer.
Parameters:
Name Type Description parametersolympe.dc.query.Parameters The parameters for the serialization.
- Implements:
Throws:
-
If the transformer is not serializable.
- Type
- Error
Returns:
The JSON representation.
- Type
- string
-
toString()
-
Gets a string representation of the transformer.
- Implements:
Returns:
The representation.
- Type
- string
Olympe SDK