This repository has been archived by the owner on Apr 18, 2023. It is now read-only.
/
OffsetResolver.txt
75 lines (50 loc) · 2.3 KB
/
OffsetResolver.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
-----------------------------------------------------------------
Baleen\\Migrations\\Delta\\Delta\\Delta\\Collection\\Resolver\\OffsetResolver
-----------------------------------------------------------------
.. php:namespace: Baleen\\Migrations\\Delta\\Delta\\Delta\\Collection\\Resolver
.. php: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)
.. php:method:: 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.
:type $alias: string
:param $alias:
:type $collection: Collection
:param $collection:
:returns: \Baleen\Migrations\Delta\Delta\Delta\DeltaInterface|null|string
.. php:method:: __construct($cacheEnabled = true)
:type $cacheEnabled: bool
:param $cacheEnabled:
.. php:method:: resolve($alias, Collection $collection)
Resolves an alias into a Delta.
:type $alias: string
:param $alias:
:type $collection: Collection
:param $collection:
:returns: DeltaInterface|null
.. php:method:: 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.
:param $alias:
:type $collection: Collection
:param $collection:
:returns: bool|null|DeltaInterface
.. php:method:: cacheSet($alias, $collection, $result)
Saves the result of resolving an alias against a given collection into the
cache.
:param $alias:
:param $collection:
:param $result:
.. php:method:: clearCache(Collection $collection = null)
:type $collection: Collection
:param $collection: