X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fuser%2FUserIdentityValue.php;h=800ac760a5f48f8bddc654ceb697186255c48ff0;hb=31f66267ae9763dcecd44c1e749fe0e91b5a3a01;hp=d1fd19de52a76778b230d29c87bc53a247648781;hpb=40ced7e89ca9cd6896cd37b4b35051ed5754eb44;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/user/UserIdentityValue.php b/includes/user/UserIdentityValue.php index d1fd19de52..800ac760a5 100644 --- a/includes/user/UserIdentityValue.php +++ b/includes/user/UserIdentityValue.php @@ -93,4 +93,14 @@ class UserIdentityValue implements UserIdentity { return $this->getName() === $user->getName(); } + /** + * @since 1.34 + * + * @return bool True if user is registered on this wiki, i.e., has a user ID. False if user is + * anonymous or has no local account (which can happen when importing). This is equivalent to + * getId() != 0 and is provided for code readability. + */ + public function isRegistered() { + return $this->getId() != 0; + } }