new PatchSerializer( [separateComplexProps])
Parameters:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
separateComplexProps |
boolean |
<optional> |
false |
- Implements:
Methods
-
createInstance(tag [, properties] [, id])
-
Creates an instance and returns it's tag
Parameters:
Name Type Argument Description tag
string New instance tag
properties
Map.<string, ?*> <optional>
Instance's properties (map of properties names to values)
id
number <optional>
operationId
- Implements:
-
createRelation(type, leftTag, rightTag [, id])
-
Creates a relation between two instances.
Parameters:
Name Type Argument Default Description type
string Tag of the relation
leftTag
string Left instance tag
rightTag
string Right instance tag
id
number <optional>
-1 operationId
- Implements:
-
deleteInstance(tag [, followRule] [, id])
-
Deletes an instance
- Removing a non existing instance does not trigger an error
- Removing an instance that still has relations does not trigger an error
Parameters:
Name Type Argument Description tag
string followRule
olympe.dc.FollowRules <optional>
id
number <optional>
operationId
- Implements:
-
deleteRelation(type, leftTag, rightTag [, id])
-
Removes a relation between two instances
Parameters:
Name Type Argument Default Description type
string Tag of the relation
leftTag
string Left instance tag
rightTag
string Right instance tag
id
number <optional>
-1 operationId
- Implements:
-
flush()
-
Returns and clears the serialization output
Returns:
- Type
- string
-
flushArray()
-
Returns the serialized patch as an array, ready to be stringify and clears the serializer
Returns:
- Type
- Array
-
flushObject()
-
Return all accumulated operations split by types.
Returns:
-
reset()
-
Resets the serialization output
-
updateInstance(tag [, properties] [, forceUpdate] [, id])
-
Updates an instance.
- If the instance does not exist, it will be automatically created
- Depending on the implementation, updates will be rejected if the provided "new" version is lower than the stored one
Parameters:
Name Type Argument Default Description tag
string Instance tag
properties
Map.<string, ?*> <optional>
Instance properties
forceUpdate
boolean <optional>
false If true, do not do any version check and accepts any update (used by rollbacks)
id
number <optional>
operationId
- Implements:
Type Definitions
-
MultiPatchContents
-
PatchContent