MediaWiki REL1_37
|
Representation of a pair of user and title for watchlist entries. More...
Public Member Functions | |
__construct (UserIdentity $user, $target, $notificationTimestamp, ?string $expiry=null) | |
getExpiry (?int $style=TS_MW) | |
When the watched item will expire. | |
getExpiryInDays () | |
Get days remaining until a watched item expires. | |
getExpiryInDaysText (MessageLocalizer $msgLocalizer, $isDropdownOption=false) | |
Get days remaining until a watched item expires as a text. | |
getLinkTarget () | |
getNotificationTimestamp () | |
Get the notification timestamp of this entry. | |
getTarget () | |
getUserIdentity () | |
isExpired () | |
Has the watched item expired? | |
Static Public Member Functions | |
static | calculateExpiryInDays (?string $expiry) |
Get the number of days remaining until the given expiry time. | |
static | newFromRecentChange (RecentChange $recentChange, UserIdentity $user) |
Private Attributes | |
ConvertibleTimestamp null | $expiry |
value that determines when a watched item will expire. | |
null string | $notificationTimestamp |
the value of the wl_notificationtimestamp field | |
LinkTarget PageIdentity | $target |
deprecated LinkTarget since 1.36 | |
UserIdentity | $user |
const | SECONDS_IN_A_DAY = 86400 |
Used to calculate how many days are remaining until a watched item will expire. | |
Representation of a pair of user and title for watchlist entries.
Definition at line 36 of file WatchedItem.php.
WatchedItem::__construct | ( | UserIdentity | $user, |
$target, | |||
$notificationTimestamp, | |||
?string | $expiry = null |
||
) |
UserIdentity | $user | |
LinkTarget | PageIdentity | $target | deprecated passing LinkTarget since 1.36 |
null | string | $notificationTimestamp | the value of the wl_notificationtimestamp field |
null | string | $expiry | Optional expiry timestamp in any format acceptable to wfTimestamp() |
Definition at line 73 of file WatchedItem.php.
References $expiry.
|
static |
Get the number of days remaining until the given expiry time.
string | null | $expiry | The expiry to calculate from, in any format supported by MWTimestamp::convert(). |
Definition at line 192 of file WatchedItem.php.
WatchedItem::getExpiry | ( | ?int | $style = TS_MW | ) |
When the watched item will expire.
int | null | $style | Given timestamp format to style the ConvertibleTimestamp |
Definition at line 150 of file WatchedItem.php.
Referenced by ApiQueryWatchlist\extractOutputData(), WatchAction\getExpiryOptions(), isExpired(), SpecialWatchlist\outputChangesList(), and Linker\tooltipAndAccesskeyAttribs().
WatchedItem::getExpiryInDays | ( | ) |
Get days remaining until a watched item expires.
Definition at line 178 of file WatchedItem.php.
WatchedItem::getExpiryInDaysText | ( | MessageLocalizer | $msgLocalizer, |
$isDropdownOption = false |
|||
) |
Get days remaining until a watched item expires as a text.
MessageLocalizer | $msgLocalizer | |
bool | $isDropdownOption | Whether the text is being displayed as a dropdown option. The text is different as a dropdown option from when it is used in other places as a watchlist indicator. |
Definition at line 218 of file WatchedItem.php.
Referenced by WatchAction\getExpiryOptions().
WatchedItem::getLinkTarget | ( | ) |
Definition at line 118 of file WatchedItem.php.
References getTarget().
WatchedItem::getNotificationTimestamp | ( | ) |
Get the notification timestamp of this entry.
Definition at line 138 of file WatchedItem.php.
Referenced by ApiQueryWatchlist\extractOutputData().
WatchedItem::getTarget | ( | ) |
Definition at line 129 of file WatchedItem.php.
Referenced by WatchedItemStore\cache(), ApiQueryWatchlist\extractOutputData(), getLinkTarget(), and ApiQueryWatchlist\run().
WatchedItem::getUserIdentity | ( | ) |
Definition at line 110 of file WatchedItem.php.
Referenced by WatchedItemStore\cache().
WatchedItem::isExpired | ( | ) |
Has the watched item expired?
Definition at line 163 of file WatchedItem.php.
References $expiry, and getExpiry().
|
static |
RecentChange | $recentChange | |
UserIdentity | $user |
Definition at line 98 of file WatchedItem.php.
References RecentChange\getTitle().
|
private |
value that determines when a watched item will expire.
'null' means that there is no expiration.
Definition at line 56 of file WatchedItem.php.
Referenced by __construct(), and isExpired().
|
private |
the value of the wl_notificationtimestamp field
Definition at line 50 of file WatchedItem.php.
|
private |
deprecated LinkTarget since 1.36
Definition at line 40 of file WatchedItem.php.
|
private |
Definition at line 45 of file WatchedItem.php.
|
private |
Used to calculate how many days are remaining until a watched item will expire.
Uses a different algorithm from Language::getDurationIntervals for calculating days remaining in an interval of time
Definition at line 65 of file WatchedItem.php.