NAME

JSONAPI::Document::Builder::Relationships - Related Resource Document builder

VERSION

version 2.2

DESCRIPTION

Builds the related resource document for a given row.

row

The DBIx::Class::Row for relationship.

Note this is not the relationship row, rather it is its parent.

relationship

String name of the relationship.

with_attributes

Boolean; Default: false

If specified, will build the relationship with attributes instead of links.

Default behaviour is to build with links.

build : HashRef

Main caller method; Builds the related resource document.

Builds a HashRef containing strings that represent URLs for fetching the given relationship, as well as the relationship ID(s).

build_document(DBIx::Class::Row $row, Str $relationship) : HashRef

Builds a HashRef of the relationship(s) with attributes.

build_single_document(DBIx::Class::Row $related_row, Str $relationship) : HashRef

Builds a HashRef representing a single relationship row.