Skip to content

Support resource identity as a pair of type and id (array) #81

@neomerx

Description

@neomerx

An idea from @lindyhopchris to support relationships not only as classes with empty attributes but as a pair of type and identity as well

public function getRelationships($comment, $includedRelationships = [])
{
    return [
        'author' => [
            static::DATA => isset($includedRelationships['author']) ? 
                $comment->getAuthor() :
                [AuthorSchema::class, $comment->author_id],
        ],
    ];
}

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions