PHP Class Flarum\Event\GetApiRelationship

This event is fired when a relationship is to be included on an API document. If a handler wishes to control the given relationship, then it should return an instance of Tobscure\JsonApi\Relationship\BuilderInterface.
See also: AbstractSerializer::hasOne()
See also: AbstractSerializer::hasMany()
See also: https://github.com/tobscure/json-api
Show file Open project: flarum/core Class Usage Examples

Public Properties

Property Type Description
$model mixed
$relationship string
$serializer Flarum\Api\Serializer\AbstractSerializer

Public Methods

Method Description
__construct ( AbstractSerializer $serializer, string $relationship, mixed $model )
isRelationship ( string $serializer, string $relationship ) : boolean

Method Details

__construct() public method

public __construct ( AbstractSerializer $serializer, string $relationship, mixed $model )
$serializer Flarum\Api\Serializer\AbstractSerializer
$relationship string
$model mixed

isRelationship() public method

public isRelationship ( string $serializer, string $relationship ) : boolean
$serializer string
$relationship string
return boolean

Property Details

$model public property

public mixed $model
return mixed

$relationship public property

public string $relationship
return string

$serializer public property

public AbstractSerializer,Flarum\Api\Serializer $serializer
return Flarum\Api\Serializer\AbstractSerializer