aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/classes/JsonApi/Schemas/ShortUrl.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/classes/JsonApi/Schemas/ShortUrl.php b/lib/classes/JsonApi/Schemas/ShortUrl.php
index ff7e90b..0313bf4 100644
--- a/lib/classes/JsonApi/Schemas/ShortUrl.php
+++ b/lib/classes/JsonApi/Schemas/ShortUrl.php
@@ -19,6 +19,24 @@ final class ShortUrl extends SchemaProvider
}
/**
+ * @param \Forum\Category $resource
+ */
+ public function hasResourceMeta($resource): bool
+ {
+ return true;
+ }
+
+ /**
+ * @param \Forum\Category $resource
+ */
+ public function getResourceMeta($resource)
+ {
+ return [
+ 'alias-link' => \URLHelper::getLink('dispatch.php/u/r/' . $resource->alias, [], true)
+ ];
+ }
+
+ /**
* @param \ShortUrl $resource
*/
public function getAttributes($resource, ContextInterface $context): iterable