1 | <?php |
||
17 | abstract class AbstractJsonApiView implements HttpAttributesAwareInterface, IncludedObjectsAwareInterface |
||
18 | { |
||
19 | use HttpAttributesContainer; |
||
20 | use IncludedObjectsContainer; |
||
21 | |||
22 | /** |
||
23 | * Callback to call after a resource-object has created. |
||
24 | * |
||
25 | * @var callable |
||
26 | */ |
||
27 | protected $resourceCallback; |
||
28 | |||
29 | /** |
||
30 | * Callback to call after a document has created. |
||
31 | * |
||
32 | * @var callable |
||
33 | */ |
||
34 | protected $documentCallback; |
||
35 | |||
36 | /** |
||
37 | * Definitions of links have to be added to document |
||
38 | * |
||
39 | * @var Link[] |
||
40 | */ |
||
41 | protected $documentLinks = []; |
||
42 | |||
43 | /** |
||
44 | * Set a callback to call after a resource-object has created. |
||
45 | * |
||
46 | * @param callable $callback |
||
47 | */ |
||
48 | public function setResourceCallback(callable $callback) |
||
52 | |||
53 | /** |
||
54 | * Has a callback to call after a resource-object has created ? |
||
55 | * |
||
56 | * @return bool |
||
57 | */ |
||
58 | public function hasResourceCallback(): bool |
||
62 | |||
63 | /** |
||
64 | * Get a callback to call after a resource-object has created. |
||
65 | * |
||
66 | * @return callable |
||
67 | */ |
||
68 | public function getResourceCallback(): callable |
||
72 | |||
73 | /** |
||
74 | * Set a callback to call after a document has created |
||
75 | * |
||
76 | * @param callable $callback |
||
77 | */ |
||
78 | public function setDocumentCallback(callable $callback) |
||
82 | |||
83 | /** |
||
84 | * Has a callback to call after a document has created |
||
85 | * |
||
86 | * @return bool |
||
87 | */ |
||
88 | public function hasDocumentCallback(): bool |
||
92 | |||
93 | /** |
||
94 | * Get a callback to call after a document has created |
||
95 | * |
||
96 | * @return callable |
||
97 | */ |
||
98 | public function getDocumentCallback(): callable |
||
102 | |||
103 | /** |
||
104 | * Add a definition of link have to be added to document |
||
105 | * |
||
106 | * @param Link $link |
||
107 | */ |
||
108 | 2 | public function addDocumentLink(Link $link) |
|
118 | |||
119 | /** |
||
120 | * Get definitions of links have to be added to document |
||
121 | * |
||
122 | * @return Link[] |
||
123 | */ |
||
124 | 2 | public function getDocumentLinks(): array |
|
128 | } |