1 | <?php |
||
23 | class JsonapiController extends \Neos\Flow\Mvc\Controller\ActionController |
||
24 | { |
||
25 | /** |
||
26 | * @var \Aimeos\Shop\Base\Aimeos |
||
27 | * @Flow\Inject |
||
28 | */ |
||
29 | protected $aimeos; |
||
30 | |||
31 | /** |
||
32 | * @var \Aimeos\Shop\Base\Context |
||
33 | * @Flow\Inject |
||
34 | */ |
||
35 | protected $context; |
||
36 | |||
37 | /** |
||
38 | * @var \Aimeos\Shop\Base\View |
||
39 | * @Flow\Inject |
||
40 | */ |
||
41 | protected $viewContainer; |
||
42 | |||
43 | |||
44 | /** |
||
45 | * Deletes the resource object or a list of resource objects |
||
46 | * |
||
47 | * @param string Resource location, e.g. "customer" |
||
48 | * @return string Response message content |
||
49 | * @Flow\Session(autoStart = TRUE) |
||
50 | */ |
||
51 | public function deleteAction( $resource ) |
||
58 | |||
59 | |||
60 | /** |
||
61 | * Returns the requested resource object or list of resource objects |
||
62 | * |
||
63 | * @param string Resource location, e.g. "customer" |
||
64 | * @return string Response message content |
||
65 | */ |
||
66 | public function getAction( $resource ) |
||
73 | |||
74 | |||
75 | /** |
||
76 | * Updates a resource object or a list of resource objects |
||
77 | * |
||
78 | * @param string Resource location, e.g. "customer" |
||
79 | * @return string Response message content |
||
80 | * @Flow\Session(autoStart = TRUE) |
||
81 | */ |
||
82 | public function patchAction( $resource ) |
||
89 | |||
90 | |||
91 | /** |
||
92 | * Creates a new resource object or a list of resource objects |
||
93 | * |
||
94 | * @param string Resource location, e.g. "customer" |
||
95 | * @return string Response message content |
||
96 | * @Flow\Session(autoStart = TRUE) |
||
97 | */ |
||
98 | public function postAction( $resource ) |
||
105 | |||
106 | |||
107 | /** |
||
108 | * Creates or updates a single resource object |
||
109 | * |
||
110 | * @param string Resource location, e.g. "customer" |
||
111 | * @return string Response message content |
||
112 | * @Flow\Session(autoStart = TRUE) |
||
113 | */ |
||
114 | public function putAction( $resource ) |
||
121 | |||
122 | |||
123 | /** |
||
124 | * Returns the available HTTP verbs and the resource URLs |
||
125 | * |
||
126 | * @param string $resource Resource location, e.g. "product" |
||
127 | * @return string Response message content |
||
128 | */ |
||
129 | public function optionsAction( $resource = '' ) |
||
136 | |||
137 | |||
138 | /** |
||
139 | * Returns the resource controller |
||
140 | * |
||
141 | * @param string Resource location, e.g. "customer" |
||
142 | * @return \Aimeos\Client\JsonApi\Iface JsonApi client |
||
143 | */ |
||
144 | protected function createClient( $resource ) |
||
161 | |||
162 | |||
163 | /** |
||
164 | * Returns a PSR-7 request object for the current request |
||
165 | * |
||
166 | * @return \Psr\Http\Message\ServerRequestInterface PSR-7 request object |
||
167 | */ |
||
168 | protected function getPsrRequest() |
||
188 | |||
189 | |||
190 | /** |
||
191 | * Set the response data from a PSR-7 response object |
||
192 | * |
||
193 | * @param \Psr\Http\Message\ResponseInterface $response PSR-7 response object |
||
194 | * @return string Response message content |
||
195 | */ |
||
196 | protected function setPsrResponse( \Psr\Http\Message\ResponseInterface $response ) |
||
206 | } |
||
207 |