getPayload()['id']; } /** * {@inheritdoc} */ public function getAttributes($resource, ContextInterface $context): iterable { return $resource->getPayload(); } /** * {@inheritdoc} */ public function getRelationships($resource, ContextInterface $context): iterable { return []; } public function getSelfLink($resource): LinkInterface { $link = new Link(true, '/courseware-blocks/' . $resource->getBlockId() .'/custom-files', false); return $link; } /** * @inheritdoc */ public function hasResourceMeta($resource): bool { return true; } public function getResourceMeta($resource) { return [ 'download-url' => $resource->getDownloadUrl() ]; } }