R3VoLuT1OneR /
jsonapi-resource
| 1 | <?php namespace JSONAPI\Resource\LinkGenerator; |
||
| 2 | |||
| 3 | use JSONAPI\Resource\Metadata\Resource; |
||
| 4 | |||
| 5 | interface LinkGeneratorInterface |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Provides links data for resource. |
||
| 9 | * Example: |
||
| 10 | * { |
||
| 11 | * self: "/user/1" |
||
| 12 | * } |
||
| 13 | * |
||
| 14 | * Return null if don't want to append links. |
||
| 15 | * Also links can be extended with new members. |
||
| 16 | * |
||
| 17 | * @param object $resource |
||
| 18 | * |
||
| 19 | * @return array<string, string>|null |
||
| 20 | */ |
||
| 21 | public function resourceLinks(object $resource): array | null; |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 22 | |||
| 23 | /** |
||
| 24 | * Provides links data for resource relation. |
||
| 25 | * Example: |
||
| 26 | * { |
||
| 27 | * self: "/user/1/relationships/relation", |
||
| 28 | * related: "/user/1/relation" |
||
| 29 | * } |
||
| 30 | * |
||
| 31 | * Return null if don't want to append links. |
||
| 32 | * Also links can be extended with new members. |
||
| 33 | * |
||
| 34 | * @param object $resource |
||
| 35 | * @param string $relationship |
||
| 36 | * |
||
| 37 | * @return array<string, string>|null |
||
| 38 | */ |
||
| 39 | public function relationshipLinks(object $resource, string $relationship): array | null; |
||
| 40 | } |