Debian Codegraph @

includes/user/Options/UserOptionsCacheEntry.php

raw symbols SCIP
1 <?php
2
3 namespace MediaWiki\User\Options;
4
5 use Wikimedia\Rdbms\IDBAccessObject;
6
7 /**
8 * @internal
9 */
10 class UserOptionsCacheEntry {
11 /**
12 * @var array<string,mixed> Values modified by setOption(), queued for update
13 */
14 public $modifiedValues = [];
15
16 /**
17 * @var array<string,string> The source name for each value in $originalValues
18 */
19 public $sources = [];
20
21 /**
22 * @var array<string,string> The value of the $global parameter to setOption()
23 */
24 public $globalUpdateActions = [];
25
26 /**
27 * @var array<string,string>|null Cached original user options with all the
28 * adjustments like time correction and hook changes applied. Ready to be
29 * returned. Null if the original values have not been loaded
30 */
31 public $originalValues;
32
33 /** @var int|null Query flags used to retrieve options from database */
34 public $recency;
35
36 /**
37 * Determine if it's OK to use cached options values for a given user and query flags
38 *
39 * @param int $recency
40 * @return bool
41 */
42 public function canUseCachedValues( $recency ) {
43 $recencyUsed = $this->recency ?? IDBAccessObject::READ_NONE;
44 return $recencyUsed >= $recency;
45 }
46 }