Baleen\Migrations\Delta\Delta\Delta\Collection\Resolver\OffsetResolver¶
-
class
OffsetResolver
¶ Class OffsetResolver.
Resolves aliases in the format: ID{OPERATOR}[COUNT]
- Operators:
- will add
-, ^ or ~ will subtract
Repeat operators consecutively works as a shortcut for COUNT. E.g. ++ will set COUNT to 2.
Count (optional) should be a number if present and takes precedence over the previous rule.
Example aliases: 123+, 123++ (same as 123+2), 123+++9 (will be simplified to 123+9)
-
doResolve
($alias, Collection $collection)¶ Resolves an alias into a Delta.
IMPROVE: this method has an NPath complexity of 400. The configured NPath complexity threshold is 200.
Parameters: - $alias (string) –
- $collection (Collection) –
Returns: BaleenMigrationsDeltaDeltaDeltaDeltaInterface|null|string
-
__construct
($cacheEnabled = true)¶ Parameters: - $cacheEnabled (bool) –
-
resolve
($alias, Collection $collection)¶ Resolves an alias into a Delta.
Parameters: - $alias (string) –
- $collection (Collection) –
Returns: DeltaInterface|null
-
cacheGet
($alias, Collection $collection)¶ Gets an alias from the cache. Returns false if nothing could be found, a Delta if the alias was previously resolved to a version, and null if the alias couldn’t be resolved in a previous call.
Parameters: - $alias –
- $collection (Collection) –
Returns: bool|null|DeltaInterface
-
cacheSet
($alias, $collection, $result)¶ Saves the result of resolving an alias against a given collection into the cache.
Parameters: - $alias –
- $collection –
- $result –
-
clearCache
(Collection $collection = null)¶ Parameters: - $collection (Collection) –