MediaWiki
REL1_39
TimezoneFilter.php
Go to the documentation of this file.
1
<?php
21
namespace
MediaWiki\Preferences
;
22
23
use
MediaWiki\User\UserTimeCorrection
;
24
25
class
TimezoneFilter
implements
Filter
{
26
30
public
function
filterForForm
( $value ) {
31
return
$value;
32
}
33
37
public
function
filterFromForm
( $tz ) {
38
if
( $tz === UserTimeCorrection::SYSTEM ) {
39
return
$tz;
40
}
41
return
(
new
UserTimeCorrection
( $tz ) )->toString();
42
}
43
}
MediaWiki\Preferences\TimezoneFilter
Definition
TimezoneFilter.php:25
MediaWiki\Preferences\TimezoneFilter\filterForForm
filterForForm( $value)
mixed
Definition
TimezoneFilter.php:30
MediaWiki\Preferences\TimezoneFilter\filterFromForm
filterFromForm( $tz)
mixed
Definition
TimezoneFilter.php:37
MediaWiki\User\UserTimeCorrection
Utility class to parse the TimeCorrection string value.
Definition
UserTimeCorrection.php:42
MediaWiki\Preferences\Filter
Base interface for user preference filters that work as a middleware between storage and interface.
Definition
Filter.php:27
MediaWiki\Preferences
Definition
DefaultPreferencesFactory.php:21
includes
preferences
TimezoneFilter.php
Generated on Tue Sep 10 2024 06:23:44 for MediaWiki by
1.10.0