phramework/jsonapi doc
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Namespaces

  • Phramework
    • JSONAPI
      • Controller
        • POST
      • Model
      • Viewers

Classes

  • Cache
  • Directives
  • Get
  • Model
  • Relationship

Class Get

Phramework\JSONAPI\Model\Model
Extended by Phramework\JSONAPI\Model\Cache
Extended by Phramework\JSONAPI\Model\Directives
Extended by Phramework\JSONAPI\Model\Get

Direct known subclasses

Phramework\JSONAPI\Model\Relationship

Indirect known subclasses

Phramework\JSONAPI\Model

Abstract
Namespace: Phramework\JSONAPI\Model
License: Apache-2.0
Author: Xenofon Spafaridis nohponex@gmail.com
Since: 1.0.0
Located at Model/Get.php

Methods summary

public static Phramework\JSONAPI\Resource[]
# get( Phramework\JSONAPI\Page $page, Phramework\JSONAPI\Filter $filter, Phramework\JSONAPI\Sort $sort, Phramework\JSONAPI\Fields $fields, mixed $additionalParameters )

Get collection of resources

Get collection of resources

Parameters

$page
[Optional]
$filter
[Optional]
$sort
[Optional]
$fields
[Optional]
$additionalParameters
$additionalParameters [Optional]

Returns

Phramework\JSONAPI\Resource[]

Throws

Phramework\Exceptions\NotImplementedException
public static Phramework\JSONAPI\Resource|object|null
# getById( string|string[] $id, Phramework\JSONAPI\Fields $fields, mixed $additionalParameters )

Get a single resource by id or multiple resource by id array

Get a single resource by id or multiple resource by id array

Parameters

$id
An id of a single resource or ids of multiple resources
$fields
[Optional]
$additionalParameters
$additionalParameters

Returns

Phramework\JSONAPI\Resource|object|null

Returns null when item is not available, returns object when multiple ids are requested, each id is used as object's key.

Example

$article = Article::get(5);

// Will return a valid resource or null in case in's not found

$article = Article::get(5);

// Will return a valid resource or null in case in's not found

public static Phramework\JSONAPI\Page|null
# parsePage( object $parameters )

Parse page for pagination by parsing request parameters and using current implementation model's rules.

Parse page for pagination by parsing request parameters and using current implementation model's rules.

Parameters

$parameters
Request parameters

Returns

Phramework\JSONAPI\Page|null
public static Phramework\JSONAPI\Sort|null
# parseSort( object $parameters )

Parse sort by parsing request parameters and using current implementation model's rules.

Parse sort by parsing request parameters and using current implementation model's rules.

Parameters

$parameters
Request parameters

Returns

Phramework\JSONAPI\Sort|null
public static Phramework\JSONAPI\Filter|null
# parseFilter( object $parameters )

Parse filter by parsing request parameters and using current implementation model's rules.

Parse filter by parsing request parameters and using current implementation model's rules.

Parameters

$parameters
Request parameters

Returns

Phramework\JSONAPI\Filter|null
public static Phramework\JSONAPI\Fields|null
# parseFields( object $parameters )

Parse fields by parsing request parameters and using current implementation model's rules.

Parse fields by parsing request parameters and using current implementation model's rules.

Parameters

$parameters
Request parameters

Returns

Phramework\JSONAPI\Fields|null

Methods inherited from Phramework\JSONAPI\Model\Directives

handleFilter(), handleGet()

Methods inherited from Phramework\JSONAPI\Model\Cache

getCache(), initializeCache(), invalidateCache(), setCache()

Methods inherited from Phramework\JSONAPI\Model\Model

getCast(), getEndpoint(), getIdAttribute(), getSchema(), getSelfLink(), getTable(), getType()

Constants summary

Constants inherited from Phramework\JSONAPI\Model\Model

GET_BY_PREFIX, GET_RELATIONSHIP_BY_PREFIX, POST_RELATIONSHIP_BY_PREFIX

Properties summary

Properties inherited from Phramework\JSONAPI\Model\Cache

$cache

Properties inherited from Phramework\JSONAPI\Model\Model

$cast, $endpoint, $idAttribute, $schema, $table, $type

phramework/jsonapi doc API documentation generated by ApiGen