BEdita API doc | 4-cactus
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Download

Namespaces

  • BEdita
    • API
      • Auth
      • Controller
        • Admin
        • Component
        • Model
      • Error
      • Event
      • Exception
      • Middleware
      • Model
        • Action
      • Network
        • Exception
      • Shell
      • TestSuite
      • Utility
    • Core
      • Configure
        • Engine
      • Database
        • Type
      • Exception
      • Filesystem
        • Adapter
        • Exception
        • Thumbnail
      • I18n
      • Job
        • Service
      • Mailer
        • Preview
        • Transport
      • Model
        • Action
        • Behavior
        • Entity
        • Table
        • Validation
      • ORM
        • Inheritance
        • Locator
        • Rule
      • Shell
        • Task
      • State
      • TestSuite
        • Fixture
      • Utility

Classes

  • JsonApiComponent

Class JsonApiComponent

Handles JSON API data format in input and in output

Cake\Controller\Component
Extended by BEdita\API\Controller\Component\JsonApiComponent
Namespace: BEdita\API\Controller\Component
Since: 4.0.0
Located at API/src/Controller/Component/JsonApiComponent.php

Methods summary

public
# initialize( array $config )
public array
# parseInput( string $json )

Input data parser for JSON API format.

Input data parser for JSON API format.

Parameters

$json
JSON string.

Returns

array
JSON API input data array

Throws

Cake\Http\Exception\BadRequestException
When the request is malformed
public
# error( integer $status, string $title, string $detail = null, string $code = null, array $meta = null )

Set occurred error.

Set occurred error.

Parameters

$status
HTTP error code.
$title
Brief description of error.
$detail
Long description of error
$code
Application specific error code.
$meta
Additional metadata about error.
public array
# getLinks( )

Get links according to JSON API specifications.

Get links according to JSON API specifications.

Returns

array
public array
# getMeta( )

Get common metadata.

Get common metadata.

Returns

array
protected
# allowedResourceTypes( mixed $types, array $data = null )

Check if given resource types are allowed.

Check if given resource types are allowed.

Parameters

$types
One or more allowed types to check resources array against.
$data
Data to be checked. By default, this is taken from the request.

Throws

Cake\Http\Exception\ConflictException
Throws an exception if a resource has a non-supported type.
protected
# allowClientGeneratedIds( boolean $allow = true, array $data = null )

Check that no resource includes a client-generated ID, if this feature is unsupported.

Check that no resource includes a client-generated ID, if this feature is unsupported.

Parameters

$allow
Should client-generated IDs be allowed?
$data
Data to be checked. By default, this is taken from the request.

Throws

Cake\Http\Exception\ForbiddenException

Throws an exception if a resource has a client-generated ID, but this feature is not supported.

public
# startup( )

Perform preliminary checks and operations.

Perform preliminary checks and operations.

Throws

BEdita\API\Network\Exception\UnsupportedMediaTypeException

Throws an exception if the Accept header does not comply to JSON API specifications and checkMediaType configuration is enabled.


Cake\Http\Exception\ConflictException

Throws an exception if a resource in the payload has a non-supported type.


Cake\Http\Exception\ForbiddenException

Throws an exception if a resource in the payload includes a client-generated ID, but the feature is not supported.

public
# beforeRender( )

Perform operations before view rendering.

Perform operations before view rendering.

Constants summary

string CONTENT_TYPE

JSON API content type.

JSON API content type.

# 'application/vnd.api+json'

Properties summary

public array $components
# ['RequestHandler']
protected array $_defaultConfig
# [ 'contentType' => null, 'checkMediaType' => true, 'resourceTypes' => null, 'clientGeneratedIds' => false, ]

Magic properties

public Cake\Controller\Component\RequestHandlerComponent $RequestHandler
BEdita API doc | 4-cactus API documentation generated by ApiGen