aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/JsonApi/Schemas/StudipProperty.php
blob: 2f23fa2dd0e9293b2b9268177cad80c5ad9e1145 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php

namespace JsonApi\Schemas;

use Neomerx\JsonApi\Contracts\Schema\ContextInterface;

class StudipProperty extends SchemaProvider
{
    const TYPE = 'studip-properties';

    public function getId($resource): ?string
    {
        return $resource->field;
    }

    public function getAttributes($resource, ContextInterface $context): iterable
    {
        return [
            'description' => $resource->description,
            'value' => $resource->value,
        ];
    }

    public function getRelationships($resource, ContextInterface $context): iterable
    {
        return [];
    }

    /**
     * @inheritdoc
     */
    public function getLinks($resource): iterable
    {
        return [];
    }
}