Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4110914
UserEntity.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
988 B
Referenced Files
None
Subscribers
None
UserEntity.php
View Options
<?php
namespace
MediaWiki\Extension\OAuth\Entity
;
use
League\OAuth2\Server\Entities\UserEntityInterface
;
use
MediaWiki\Extension\OAuth\Backend\Utils
;
use
MediaWiki\User\User
;
use
MWException
;
class
UserEntity
implements
UserEntityInterface
{
/**
* @var int
*/
private
$identifier
;
/**
* @param User $user
* @return UserEntity|null
*/
public
static
function
newFromMWUser
(
User
$user
)
{
try
{
$userId
=
Utils
::
getCentralIdFromLocalUser
(
$user
);
if
(
!
$userId
)
{
return
null
;
}
return
new
static
(
$userId
);
}
catch
(
MWException
$ex
)
{
return
null
;
}
}
/**
* @param int $identifier
*/
public
function
__construct
(
$identifier
)
{
$this
->
identifier
=
$identifier
;
}
/**
* Return the user's identifier.
*
* @return int
*/
public
function
getIdentifier
()
{
return
$this
->
identifier
;
}
/**
* @return User|false
*/
public
function
getMWUser
()
{
return
Utils
::
getLocalUserFromCentralId
(
$this
->
identifier
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 22:04 (1 d, 8 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
8a/2b/1c997dd68c27ae857d262330b563
Default Alt Text
UserEntity.php (988 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment