Flarum\Api\Serializer\AbstractSerializer::getCustomRelationship PHP Method

getCustomRelationship() protected method

Get a custom relationship.
protected getCustomRelationship ( mixed $model, string $name ) : Relationship | null
$model mixed
$name string
return Tobscure\JsonApi\Relationship | null
    protected function getCustomRelationship($model, $name)
    {
        $relationship = static::$dispatcher->until(new GetApiRelationship($this, $name, $model));
        if ($relationship && !$relationship instanceof Relationship) {
            throw new LogicException('GetApiRelationship handler must return an instance of ' . Relationship::class);
        }
        return $relationship;
    }