MetaFox

UserEntityDetail extends JsonResource
in package
Uses UserLocationTrait, UserStatisticTrait, ExtraTrait

Class UserDetail.

Table of Contents

Properties

$resource  : UserEntity|stdClass

Methods

__construct()  : mixed
Special case when user is deleted and the relation is null Laravel auto return null if $resource property is null so need to override to bypass default behavior of Laravel.
canViewLocation()  : bool
getExtra()  : array<string|int, mixed>
getExtraAttributes()  : array<string|int, mixed>
getLocation()  : array<string, mixed>
getLocationValue()  : string
toArray()  : array<string, mixed>
Transform the resource collection into an array.
getAvatarId()  : int|null
This method shall be removed from version 5.2 Temporary solution for mobile app to avoid crash.
getDeletedUserResource()  : array<string, mixed>
getResourceCovers()  : array<string, mixed>|null
getResourceStatistics()  : array<string, mixed>
getStatistic()  : array<string, mixed>

Properties

Methods

__construct()

Special case when user is deleted and the relation is null Laravel auto return null if $resource property is null so need to override to bypass default behavior of Laravel.

public __construct(UserEntity|null $resource) : mixed
Parameters
$resource : UserEntity|null

getExtra()

public getExtra([mixed $resolution = null ]) : array<string|int, mixed>
Parameters
$resolution : mixed = null
Return values
array<string|int, mixed>

getExtraAttributes()

public getExtraAttributes(User $context) : array<string|int, mixed>
Parameters
$context : User
Return values
array<string|int, mixed>

getLocation()

public getLocation(User $context, User $resource) : array<string, mixed>
Parameters
$context : User
$resource : User
Return values
array<string, mixed>

getLocationValue()

public getLocationValue(User $context, mixed $resource) : string
Parameters
$context : User
$resource : mixed
Return values
string

toArray()

Transform the resource collection into an array.

public toArray(Request $request) : array<string, mixed>
Parameters
$request : Request
Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

throws
AuthenticationException
Return values
array<string, mixed>

getAvatarId()

This method shall be removed from version 5.2 Temporary solution for mobile app to avoid crash.

protected getAvatarId(User $context, UserEntity|null $user) : int|null
Parameters
$context : User
$user : UserEntity|null
Tags
deprecated
5.2
Return values
int|null

getDeletedUserResource()

protected getDeletedUserResource() : array<string, mixed>
Return values
array<string, mixed>

getResourceCovers()

protected getResourceCovers(User $user) : array<string, mixed>|null
Parameters
$user : User
Return values
array<string, mixed>|null

getResourceStatistics()

protected getResourceStatistics(Request|null $request) : array<string, mixed>
Parameters
$request : Request|null
Return values
array<string, mixed>

getStatistic()

protected getStatistic() : array<string, mixed>
Tags
throws
AuthenticationException
Return values
array<string, mixed>

        
On this page

Search results