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

Namespaces

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

Classes

  • Cache
  • Directives
  • Get
  • Model
  • Relationship

Class Model

Base JSONAPI Model

Direct known subclasses

Phramework\JSONAPI\Model\Cache

Indirect known subclasses

Phramework\JSONAPI\Model, Phramework\JSONAPI\Model\Directives, Phramework\JSONAPI\Model\Get, Phramework\JSONAPI\Model\Relationship

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

Methods summary

public static array
# getCast( )

Records's type casting schema

Records's type casting schema

This object contains the rules applied to fetched data from database in order to have correct data types.

Returns

array

Uses

static::$cast If cast is not null

static::getValidationModel If static::$cast is null, it uses validationModel's attributes to extract the cast schema


Todo

Rewrite validationModel's attributes
public static string
# getType( )

Get resource's type

Get resource's type

Returns

string
public static string|null
# getTable( )

Get resource's table name

Get resource's table name

Returns

string|null
public static string|null
# getSchema( )

Get resource's table schema name

Get resource's table schema name

Returns

string|null
public static string
# getIdAttribute( )

Resource's identification attribute (Primary key column in database)

Resource's identification attribute (Primary key column in database)

Returns

string
public static string
# getEndpoint( )

Get resource's endpoint

Get resource's endpoint

Returns

string
public static string
# getSelfLink( string $appendString = '' )

Get link to resource's self

Get link to resource's self

Parameters

$appendString

Returns

string

Uses

Phramework::getSetting with key "base"

Constants summary

string GET_RELATIONSHIP_BY_PREFIX

Model's method prefix, following by ucfirst(type of resource) for example getRelationshipByInput_template if is was input_template $resource->id, $relationshipKey, $filter

Model's method prefix, following by ucfirst(type of resource) for example getRelationshipByInput_template if is was input_template $resource->id, $relationshipKey, $filter

# 'getRelationshipBy'
string POST_RELATIONSHIP_BY_PREFIX

Model's method prefix, following by ucfirst(type of resource) for example postRelationshipByInput_template if is was input_template

Model's method prefix, following by ucfirst(type of resource) for example postRelationshipByInput_template if is was input_template

# 'postRelationshipBy'
string GET_BY_PREFIX

Model's method prefix

Model's method prefix

Deprecated

# 'getBy'

Properties summary

protected static string $type

Resource's type, used to describe resource objects that share common attributes and relationships MUST be overwritten

Resource's type, used to describe resource objects that share common attributes and relationships MUST be overwritten

# null
protected static string|null $table

Resource's table name MAY be overwritten, default is null (no database)

Resource's table name MAY be overwritten, default is null (no database)

# null
protected static string|null $schema

Resource's table's schema name MAY be overwritten, default is null (no schema)

Resource's table's schema name MAY be overwritten, default is null (no schema)

# null
protected static string $idAttribute

Resource's identification attribute (Primary key in database). MAY be overwritten, default is "id"

Resource's identification attribute (Primary key in database). MAY be overwritten, default is "id"

# 'id'
protected static string $endpoint

Resource's endpoint, used for access by external request, usually it the same as type MUST be overwritten

Resource's endpoint, used for access by external request, usually it the same as type MUST be overwritten

# null
protected static array|null $cast

Records's type casting schema for database records MAY be overwritten Also it can be set to empty array to disable type casting for this resource.

Records's type casting schema for database records MAY be overwritten Also it can be set to empty array to disable type casting for this resource.

# null
phramework/jsonapi doc API documentation generated by ApiGen