Go to the documentation of this file.
25 use Wikimedia\Timestamp\ConvertibleTimestamp;
83 $this->expiry = ExpiryDef::normalizeExpiry(
$expiry );
86 if ( $this->expiry ===
'infinity' ) {
101 $recentChange->notificationtimestamp,
102 $recentChange->watchlistExpiry
146 return $this->expiry instanceof ConvertibleTimestamp
147 ? $this->expiry->getTimestamp( $style )
163 return $expiry < ConvertibleTimestamp::now();
192 $unixTimeExpiry = MWTimestamp::convert( TS_UNIX,
$expiry );
196 if ( $diffInDays < 1 ) {
200 return (
int)ceil( $diffInDays );
215 if ( $expiryInDays ===
null ) {
219 if ( $expiryInDays < 1 ) {
220 if ( $isDropdownOption ) {
221 return $msgLocalizer->
msg(
'watchlist-expiry-hours-left' )->text();
223 return $msgLocalizer->
msg(
'watchlist-expiring-hours-full-text' )->text();
226 if ( $isDropdownOption ) {
227 return $msgLocalizer->
msg(
'watchlist-expiry-days-left', [ $expiryInDays ] )->text();
230 return $msgLocalizer->
msg(
'watchlist-expiring-days-full-text', [ $expiryInDays ] )->text();
null string $notificationTimestamp
the value of the wl_notificationtimestamp field
Utility class for creating new RC entries.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
static newFromIdentity(UserIdentity $identity)
Returns a User object corresponding to the given UserIdentity.
static newFromRecentChange(RecentChange $recentChange, UserIdentity $user)
Interface for localizing messages in MediaWiki.
getExpiry(?int $style=TS_MW)
When the watched item will expire.
__construct(UserIdentity $user, LinkTarget $linkTarget, $notificationTimestamp, ?string $expiry=null)
msg( $key,... $params)
This is the method for getting translated interface messages.
ConvertibleTimestamp null $expiry
value that determines when a watched item will expire.
static calculateExpiryInDays(?string $expiry)
Get the number of days remaining until the given expiry time.
Representation of a pair of user and title for watchlist entries.
getExpiryInDaysText(MessageLocalizer $msgLocalizer, $isDropdownOption=false)
Get days remaining until a watched item expires as a text.
const SECONDS_IN_A_DAY
Used to calculate how many days are remaining until a watched item will expire.
isExpired()
Has the watched item expired?
getNotificationTimestamp()
Get the notification timestamp of this entry.
getExpiryInDays()
Get days remaining until a watched item expires.