Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | |
3 | namespace Flow\Data; |
4 | |
5 | /** |
6 | * Compact rows before writing to cache, expand when receiving back |
7 | * Still returns arrays, just removes unnecessary values. |
8 | */ |
9 | interface Compactor { |
10 | /** |
11 | * @param array $row A data model row to strip unnecessary data from |
12 | * @return array Only the values in $row that will be written to the cache |
13 | */ |
14 | public function compactRow( array $row ); |
15 | |
16 | /** |
17 | * @param array $rows Multiple data model rows to strip unnecesssary data from |
18 | * @return array The provided rows now containing only the values the will be written to cache |
19 | */ |
20 | public function compactRows( array $rows ); |
21 | |
22 | /** |
23 | * Repopulate BagOStuff::multiGet results with any values removed in self::compactRow |
24 | * |
25 | * @param array $cached The multi-dimensional array results of BagOStuff::multiGet |
26 | * @param array $keyToQuery An array mapping memcache-key to the values used to generate that cache key |
27 | * @return array The cached content from memcache along with any data stripped in self::compactRow |
28 | */ |
29 | public function expandCacheResult( array $cached, array $keyToQuery ); |
30 | } |