MetaFox

ApiResourceManager
in package

Class ApiResourceManager.

Table of Contents

Properties

$container  : array<string, array<string, array<string, string>>>
$majorVersion  : string
$version  : string
$cached  : array<string, mixed>
$cacheStore  : Repository
$request  : Request

Methods

asDetail()  : JsonResource|null
asEmbed()  : JsonResource|null
asItem()  : JsonResource|null
asJson()  : array<string|int, mixed>|null
asResource()  : JsonResource|null
detail()  : array<string|int, mixed>|null
embed()  : array<string|int, mixed>|null
embeds()  : array<string|int, mixed>|null
getHttpResourceClass()  : string
getItem()  : mixed
getMajorVersion()  : string
getVersion()  : string
item()  : array<string|int, mixed>|null
items()  : array<string|int, mixed>|null
pickNearestVersion()  : string|null
setVersion()  : void
toCollection()  : ResourceCollection<string|int, JsonResource>|null
toItem()  : JsonResource|null
toResource()  : JsonResource|null
user()  : array<string|int, mixed>|null
loadResourceVersions()  : void
pickHttpResourceVersion()  : string

Properties

$container

protected array<string, array<string, array<string, string>>> $container = []

Methods

asDetail()

public asDetail(mixed $entity[, bool $checkPrivacy = 'view' ]) : JsonResource|null
Parameters
$entity : mixed
$checkPrivacy : bool = 'view'
Tags
throws
AuthenticationException
Return values
JsonResource|null

asEmbed()

public asEmbed(mixed $entity[, mixed $checkPrivacy = 'view' ]) : JsonResource|null
Parameters
$entity : mixed
$checkPrivacy : mixed = 'view'
Tags
throws
AuthenticationException
Return values
JsonResource|null

asItem()

public asItem(mixed $entity[, mixed $checkPrivacy = true ]) : JsonResource|null
Parameters
$entity : mixed
$checkPrivacy : mixed = true
Tags
throws
AuthenticationException
Return values
JsonResource|null

asJson()

public asJson( $entity, string $variant[, mixed $checkPrivacy = 'view' ]) : array<string|int, mixed>|null
Parameters
$entity :
$variant : string
$checkPrivacy : mixed = 'view'
Tags
throws
AuthenticationException
throws
InvalidArgumentException
Return values
array<string|int, mixed>|null

asResource()

public asResource(mixed|null $entity, string $variant[, mixed $checkPrivacy = 'view' ]) : JsonResource|null
Parameters
$entity : mixed|null
$variant : string

item, embed, detail

$checkPrivacy : mixed = 'view'
Tags
throws
AuthenticationException
Return values
JsonResource|null

detail()

public detail(mixed $entity[, bool $checkPrivacy = 'view' ]) : array<string|int, mixed>|null
Parameters
$entity : mixed
$checkPrivacy : bool = 'view'
Tags
throws
AuthenticationException|InvalidArgumentException
Return values
array<string|int, mixed>|null

embed()

public embed(mixed $entity[, bool $checkPrivacy = 'view' ]) : array<string|int, mixed>|null
Parameters
$entity : mixed
$checkPrivacy : bool = 'view'
Tags
throws
AuthenticationException|InvalidArgumentException
Return values
array<string|int, mixed>|null

embeds()

public embeds(Collection $items[, mixed $checkPrivacy = 'view' ]) : array<string|int, mixed>|null
Parameters
$items : Collection
$checkPrivacy : mixed = 'view'
Return values
array<string|int, mixed>|null

getHttpResourceClass()

public getHttpResourceClass(string $type, string $variant) : string
Parameters
$type : string
$variant : string
Return values
string

getItem()

public getItem(mixed $alias, mixed $id) : mixed
Parameters
$alias : mixed
$id : mixed

item()

public item(mixed $entity[, bool $checkPrivacy = 'view' ]) : array<string|int, mixed>|null
Parameters
$entity : mixed
$checkPrivacy : bool = 'view'
Tags
throws
AuthenticationException|InvalidArgumentException
Return values
array<string|int, mixed>|null

items()

public items(Collection $items[, mixed $checkPrivacy = 'view' ]) : array<string|int, mixed>|null
Parameters
$items : Collection
$checkPrivacy : mixed = 'view'
Return values
array<string|int, mixed>|null

pickNearestVersion()

public pickNearestVersion(array<string|int, string> $versions) : string|null
Parameters
$versions : array<string|int, string>
Return values
string|null

toCollection()

public toCollection() : ResourceCollection<string|int, JsonResource>|null
Return values
ResourceCollection<string|int, JsonResource>|null

toItem()

public toItem(mixed $alias, mixed $id[, mixed $checkPrivacy = 'view' ]) : JsonResource|null
Parameters
$alias : mixed
$id : mixed
$checkPrivacy : mixed = 'view'
Return values
JsonResource|null

toResource()

public toResource(mixed $variant, mixed $alias, mixed $id[, mixed $checkPrivacy = 'view' ]) : JsonResource|null
Parameters
$variant : mixed
$alias : mixed
$id : mixed
$checkPrivacy : mixed = 'view'
Return values
JsonResource|null

user()

public user(mixed $entity[, bool $checkPrivacy = false ]) : array<string|int, mixed>|null
Parameters
$entity : mixed
$checkPrivacy : bool = false
Tags
throws
AuthenticationException|InvalidArgumentException
Return values
array<string|int, mixed>|null

pickHttpResourceVersion()

private pickHttpResourceVersion(string $type, string $variant, string $version) : string
Parameters
$type : string
$variant : string
$version : string
Return values
string

        
On this page

Search results