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 Sort

Sort helper methods

Namespace: Phramework\JSONAPI
License: Apache-2.0
Author: Xenofon Spafaridis nohponex@gmail.com
Since: 1.0.0
Todo: allow multiple values for sort
Located at Sort.php

Methods summary

public
# __construct( $table, string $attribute, boolean $ascending = true )

Sort constructor.

Sort constructor.

Parameters

$table
$attribute
$ascending
public
# validate( string $modelClass )

Parameters

$modelClass

Todo

public static Phramework\JSONAPI\Sort
# parseFromParameters( object $parameters, string $modelClass )

Parameters

$parameters
Request parameters
$modelClass

Returns

Phramework\JSONAPI\Sort
$sort = Sort::parseFromParameters(
    (object) [
        'sort' => '-updated'
    ], //Request parameters object
    Article::class
);

Throws

Phramework\Exceptions\RequestException
public mixed
# __get( string $name )

Parameters

$name

Returns

mixed

Throws

Exception

Properties summary

protected string $table
#
protected boolean $ascending
#
protected string $attribute
#
protected $default

Deprecated

#

Magic properties

public read-only string $table
public read-only boolean $ascending
public read-only string $attribute
phramework/jsonapi doc API documentation generated by ApiGen