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

Namespaces

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

Classes

  • Controller
  • Fields
  • Filter
  • FilterAttribute
  • FilterJSONAttribute
  • Model
  • Page
  • Relationship
  • RelationshipResource
  • Resource
  • Sort
  • Util
  • ValidationModel

Class Page

Page helper methods

Phramework\JSONAPI\Page implements JsonSerializable
Namespace: Phramework\JSONAPI
License: Apache-2.0
Author: Xenofon Spafaridis nohponex@gmail.com
Since: 1.0.0
Located at Page.php

Methods summary

public
# __construct( integer|null $limit = null, integer $offset = 0 )

Parameters

$limit
$offset
public static Phramework\JSONAPI\Page|null
# parseFromParameters( object $parameters, $modelClass )

Parameters

$parameters
Request parameters
$modelClass

Returns

Phramework\JSONAPI\Page|null

Throws

Phramework\Exceptions\IncorrectParametersException

Todo

add default pagination based on $modelClass

$page = Page::parseFromParameters(
    (object) [
        'page' => [
            'limit' => 0,
            'offset' => 0
        ]
    ], //Request parameters object
    Article::class
);

public mixed
# __get( string $name )

Parameters

$name

Returns

mixed

Throws

Exception
public
# jsonSerialize( )

Implementation of

JsonSerializable::jsonSerialize()

Properties summary

protected integer $offset
#
protected integer|null $limit
#

Magic properties

public read-only integer|null $limit
public read-only integer $offset
phramework/jsonapi doc API documentation generated by ApiGen