class Context extends Context

Properties

int|string|null $modelId
array|null $requestIncludes
$search
protected array $internal Data passed internally when reusing resource endpoint logic.
protected array $parameters Parameters mutated on the current instance.

Methods

__construct(JsonApi $api, ServerRequestInterface $request)

No description

array
fields(Resource $resource)

Get the fields for the given resource, keyed by name.

withSearchResults(SearchResults $search)

No description

withInternal(string $key, mixed $value)

No description

SearchResults|null
getSearchResults()

No description

mixed
internal(string $key, mixed $default = null)

No description

getActor()

No description

setParam(string $key, mixed $default = null)

No description

mixed
getParam(string $key, mixed $default = null)

No description

bool
creating(string|null $resource = null)

No description

bool
updating(string|null $resource = null)

No description

bool
deleting(string|null $resource = null)

No description

bool
showing(string|null $resource = null)

No description

bool
listing(string|null $resource = null)

No description

withRequest(ServerRequestInterface $request)

No description

withModelId(int|string|null $id)

No description

withRequestIncludes(array $requestIncludes)

No description

string|null
extractIdFromPath(Context $context)

No description

Details

__construct(JsonApi $api, ServerRequestInterface $request)

Parameters

JsonApi $api
ServerRequestInterface $request

array fields(Resource $resource)

Get the fields for the given resource, keyed by name.

Parameters

Resource $resource

Return Value

array

Context withSearchResults(SearchResults $search)

Parameters

SearchResults $search

Return Value

Context

Context withInternal(string $key, mixed $value)

Parameters

string $key
mixed $value

Return Value

Context

SearchResults|null getSearchResults()

Return Value

SearchResults|null

mixed internal(string $key, mixed $default = null)

Parameters

string $key
mixed $default

Return Value

mixed

User getActor()

Return Value

User

Context setParam(string $key, mixed $default = null)

Parameters

string $key
mixed $default

Return Value

Context

mixed getParam(string $key, mixed $default = null)

Parameters

string $key
mixed $default

Return Value

mixed

bool creating(string|null $resource = null)

Parameters

string|null $resource

Return Value

bool

bool updating(string|null $resource = null)

Parameters

string|null $resource

Return Value

bool

bool deleting(string|null $resource = null)

Parameters

string|null $resource

Return Value

bool

bool showing(string|null $resource = null)

Parameters

string|null $resource

Return Value

bool

bool listing(string|null $resource = null)

Parameters

string|null $resource

Return Value

bool

Context withRequest(ServerRequestInterface $request)

Parameters

ServerRequestInterface $request

Return Value

Context

Context withModelId(int|string|null $id)

Parameters

int|string|null $id

Return Value

Context

Context withRequestIncludes(array $requestIncludes)

Parameters

array $requestIncludes

Return Value

Context

string|null extractIdFromPath(Context $context)

Parameters

Context $context

Return Value

string|null