Class Resource
- stdClass
- Phramework\JSONAPI\Resource implements JsonSerializable
Direct known subclasses
Namespace: Phramework\JSONAPI
License: Apache-2.0
Author: Xenofon Spafaridis nohponex@gmail.com
Since: 1.0.0
Todo:
Located at Resource.php
License: Apache-2.0
Author: Xenofon Spafaridis nohponex@gmail.com
Since: 1.0.0
Todo:
add magic set and get, set will instantiate a property if it's null, to reduce output of json to minimal required
Located at Resource.php
Methods summary
public
|
|
public
|
|
public
mixed
|
|
public static
|
#
parseFromRecords( $records, $modelClass,
|
public static
|
#
parseFromRecord( array|object $record, string $modelClass,
|
public
|
Constants summary
string |
META_MEMBER
|
#
'attributes-meta'
|
integer |
PARSE_DEFAULT
|
#
15
|
integer |
PARSE_ATTRIBUTES
|
#
1
|
integer |
PARSE_LINKS
|
#
2
|
integer |
PARSE_RELATIONSHIP
|
#
4
|
integer |
PARSE_RELATIONSHIP_LINKS
|
#
8
|
integer |
PARSE_RELATIONSHIP_DATA
|
#
16
|
integer |
PARSE_META
|
#
128
|
Properties summary
protected
string
|
$type
Resource's type |
|
protected
string
|
$id
NOTE The id member is not required when the resource object originates at the client and represents a new resource to be created on the server. |
Magic properties
public
string
|
$links
|
public
string
|
$attributes
|
public
string
|
$relationships
|
public
string
|
$data
|
public read-only
string
|
$id
|
public read-only
string
|
$type
|