MediaWiki master
|
Represents a "user group membership" – a specific instance of a user belonging to a group. More...
Public Member Functions | |
__construct (int $userId=0, ?string $group=null, ?string $expiry=null) | |
equals (UserGroupMembership $ugm) | |
Compares two pure value objects. | |
getExpiry () | |
getGroup () | |
getUserId () | |
isExpired () | |
Has the membership expired? | |
Static Public Member Functions | |
static | getGroupPage ( $group) |
Gets the title of a page describing a particular user group. | |
static | getLink ( $ugm, IContextSource $context, string $format, $userName=null) |
Gets a link for a user group, possibly including the expiry date if relevant. | |
static | getLinkHTML ( $ugm, IContextSource $context, $userName=null) |
Gets a link for a user group, possibly including the expiry date if relevant. | |
static | getLinkWiki ( $ugm, IContextSource $context, $userName=null) |
Gets a link for a user group, possibly including the expiry date if relevant. | |
Represents a "user group membership" – a specific instance of a user belonging to a group.
For example, the fact that user Mary belongs to the sysop group is a user group membership.
The class is a pure value object. Use UserGroupManager to modify user group memberships.
Definition at line 40 of file UserGroupMembership.php.
MediaWiki\User\UserGroupMembership::__construct | ( | int | $userId = 0, |
?string | $group = null, | ||
?string | $expiry = null ) |
int | $userId | The ID of the user who belongs to the group |
string | null | $group | The internal group name |
string | null | $expiry | Timestamp of expiry in TS_MW format, or null if no expiry |
Definition at line 59 of file UserGroupMembership.php.
References wfTimestampNow().
MediaWiki\User\UserGroupMembership::equals | ( | UserGroupMembership | $ugm | ) |
Compares two pure value objects.
UserGroupMembership | $ugm |
Definition at line 270 of file UserGroupMembership.php.
References MediaWiki\User\UserGroupMembership\getGroup(), and MediaWiki\User\UserGroupMembership\getUserId().
MediaWiki\User\UserGroupMembership::getExpiry | ( | ) |
Definition at line 83 of file UserGroupMembership.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences().
MediaWiki\User\UserGroupMembership::getGroup | ( | ) |
Definition at line 76 of file UserGroupMembership.php.
Referenced by MediaWiki\User\UserGroupMembership\equals().
|
static |
Gets the title of a page describing a particular user group.
When the name of the group appears in the UI, it can link to this page.
string | $group | Internal group name |
Definition at line 251 of file UserGroupMembership.php.
References wfMessage().
|
static |
Gets a link for a user group, possibly including the expiry date if relevant.
string | UserGroupMembership | $ugm | Either a group name as a string, or a UserGroupMembership object |
IContextSource | $context | |
string | $format | Either 'wiki' or 'html' |
string | null | $userName | If you want to use the group member message ("administrator"), pass the name of the user who belongs to the group; it is used for GENDER of the group member message. If you instead want the group name message ("Administrators"), omit this parameter. |
Definition at line 111 of file UserGroupMembership.php.
References MediaWiki\User\UserGroupMembership\getLinkHTML(), and MediaWiki\User\UserGroupMembership\getLinkWiki().
|
static |
Gets a link for a user group, possibly including the expiry date if relevant.
string | UserGroupMembership | $ugm | Either a group name as a string, or a UserGroupMembership object |
IContextSource | $context | |
string | null | $userName | If you want to use the group member message ("administrator"), pass the name of the user who belongs to the group; it is used for GENDER of the group member message. If you instead want the group name message ("Administrators"), omit this parameter. |
Definition at line 136 of file UserGroupMembership.php.
Referenced by MediaWiki\User\UserGroupMembership\getLink().
|
static |
Gets a link for a user group, possibly including the expiry date if relevant.
string | UserGroupMembership | $ugm | Either a group name as a string, or a UserGroupMembership object |
IContextSource | $context | |
string | null | $userName | If you want to use the group member message ("administrator"), pass the name of the user who belongs to the group; it is used for GENDER of the group member message. If you instead want the group name message ("Administrators"), omit this parameter. |
Definition at line 177 of file UserGroupMembership.php.
Referenced by MediaWiki\User\UserGroupMembership\getLink().
MediaWiki\User\UserGroupMembership::getUserId | ( | ) |
Definition at line 69 of file UserGroupMembership.php.
Referenced by MediaWiki\User\UserGroupMembership\equals().
MediaWiki\User\UserGroupMembership::isExpired | ( | ) |