Class Relationship
JSONAPI relationship class
Namespace: Phramework\JSONAPI
License: Apache-2.0
Author: Xenofon Spafaridis nohponex@gmail.com
Since: 0.0.0
Located at Relationship.php
License: Apache-2.0
Author: Xenofon Spafaridis nohponex@gmail.com
Since: 0.0.0
Located at Relationship.php
Methods summary
public
|
#
__construct( string $modelClass, integer $type = Relationship::TYPE_TO_ONE, string|null $recordDataAttribute = null, callable|object|null $callbacks = null, integer $flags = Relationship::FLAG_DEFAULT )
|
public
mixed
|
|
public
|
Constants summary
integer |
FLAG_DEFAULT
|
#
0
|
integer |
FLAG_ATTRIBUTES
|
#
1
|
integer |
FLAG_DATA
|
#
2
|
integer |
FLAG_INCLUDE_BY_DEFAULT
Include relationship by default |
#
32
|
integer |
TYPE_TO_ONE
Relationship type to one resource. |
#
1
|
integer |
TYPE_TO_MANY
Relationship type to zero, one or more resources. |
#
2
|
Properties summary
protected
string
|
$modelClass
Class path of relationship resource model |
|
protected
integer
|
$type
The type of relationship from the resource to relationship resource |
|
protected
string|null
|
$recordDataAttribute
Attribute name in record containing relationship data |
|
protected
object
|
$callbacks
Callable method can be used to fetch relationship data, see TODO |
|
protected
integer
|
$flags
Relationship flags |
Magic properties
public read-only
string
|
$modelClass
|
public read-only
integer
|
$type
|
public read-only
string|null
|
$recordDataAttribute
|
public read-only
object
|
$callbacks
|
public read-only
integer
|
$flags
|