1 | <?php |
||
15 | final class CollectionHelper |
||
16 | { |
||
17 | public const DEFAULT_STRATEGY = ClassMetadata::STORAGE_STRATEGY_PUSH_ALL; |
||
18 | |||
19 | /** |
||
20 | * Returns whether update query must be included in query updating owning document. |
||
21 | */ |
||
22 | public static function isAtomic(string $strategy) : bool |
||
23 | { |
||
24 | return $strategy === ClassMetadata::STORAGE_STRATEGY_ATOMIC_SET || $strategy === ClassMetadata::STORAGE_STRATEGY_ATOMIC_SET_ARRAY; |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * Returns whether Collection hold associative array. |
||
29 | */ |
||
30 | public static function isHash(string $strategy) : bool |
||
31 | { |
||
32 | return $strategy === ClassMetadata::STORAGE_STRATEGY_SET || $strategy === ClassMetadata::STORAGE_STRATEGY_ATOMIC_SET; |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | 267 | * Returns whether Collection hold array indexed by consecutive numbers. |
|
37 | */ |
||
38 | 267 | public static function isList(?string $strategy) : bool |
|
42 | |||
43 | /** |
||
44 | 204 | * Returns whether strategy uses $set to update its data. |
|
45 | */ |
||
46 | 204 | public static function usesSet(string $strategy) : bool |
|
58 | } |
||
59 |