1 | <?php |
||
23 | class JsonadmController 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\I18n |
||
39 | * @Flow\Inject |
||
40 | */ |
||
41 | protected $i18n; |
||
42 | |||
43 | /** |
||
44 | * @var \Aimeos\Shop\Base\Locale |
||
45 | * @Flow\Inject |
||
46 | */ |
||
47 | protected $locale; |
||
48 | |||
49 | /** |
||
50 | * @var \Aimeos\Shop\Base\View |
||
51 | * @Flow\Inject |
||
52 | */ |
||
53 | protected $viewContainer; |
||
54 | |||
55 | |||
56 | /** |
||
57 | * Deletes the resource object or a list of resource objects |
||
58 | * |
||
59 | * @param string $resource Resource location, e.g. "product/property/type" |
||
60 | * @param string $site Unique site code |
||
61 | * @return string Response message content |
||
62 | */ |
||
63 | public function deleteAction( $resource, $site = 'default' ) |
||
72 | |||
73 | |||
74 | /** |
||
75 | * Returns the requested resource object or list of resource objects |
||
76 | * |
||
77 | * @param string $resource Resource location, e.g. "product/property/type" |
||
78 | * @param string $site Unique site code |
||
79 | * @return string Response message content |
||
80 | */ |
||
81 | public function getAction( $resource, $site = 'default' ) |
||
90 | |||
91 | |||
92 | /** |
||
93 | * Updates a resource object or a list of resource objects |
||
94 | * |
||
95 | * @param string $resource Resource location, e.g. "product/property/type" |
||
96 | * @param string $site Unique site code |
||
97 | * @return string Response message content |
||
98 | */ |
||
99 | public function patchAction( $resource, $site = 'default' ) |
||
108 | |||
109 | |||
110 | /** |
||
111 | * Creates a new resource object or a list of resource objects |
||
112 | * |
||
113 | * @param string $resource Resource location, e.g. "product/property/type" |
||
114 | * @param string $site Unique site code |
||
115 | * @return string Response message content |
||
116 | */ |
||
117 | public function postAction( $resource, $site = 'default' ) |
||
126 | |||
127 | |||
128 | /** |
||
129 | * Creates or updates a single resource object |
||
130 | * |
||
131 | * @param string $resource Resource location, e.g. "product/property/type" |
||
132 | * @param string $site Unique site code |
||
133 | * @return string Response message content |
||
134 | */ |
||
135 | public function putAction( $resource, $site = 'default' ) |
||
144 | |||
145 | |||
146 | /** |
||
147 | * Returns the available HTTP verbs and the resource URLs |
||
148 | * |
||
149 | * @param string $resource Resource location, e.g. "product/property/type" |
||
150 | * @param string $site Unique site code |
||
151 | * @return string Response message content |
||
152 | */ |
||
153 | public function optionsAction( $resource = '', $site = 'default' ) |
||
162 | |||
163 | |||
164 | /** |
||
165 | * Returns the resource controller |
||
166 | * |
||
167 | * @param string $sitecode Unique site code |
||
168 | * @param string Resource location, e.g. "product/property/type" |
||
169 | * @param string $lang Language code |
||
170 | * @return \Aimeos\Admin\JsonAdm\Iface JsonAdm client |
||
171 | */ |
||
172 | protected function createAdmin( $sitecode, $resource, $lang ) |
||
173 | { |
||
174 | $aimeos = $this->aimeos->get(); |
||
175 | $lang = ( $lang ? $lang : 'en' ); |
||
176 | $templatePaths = $aimeos->getCustomPaths( 'admin/jsonadm/templates' ); |
||
177 | |||
178 | $context = $this->context->get( null, 'backend' ); |
||
179 | $context->setI18n( $this->i18n->get( array( $lang, 'en' ) ) ); |
||
180 | $context->setLocale( $this->locale->getBackend( $context, $sitecode ) ); |
||
181 | $context->setView( $this->viewContainer->create( $context, $this->uriBuilder, $templatePaths, $this->request, $lang ) ); |
||
182 | |||
183 | return \Aimeos\Admin\JsonAdm::create( $context, $aimeos, $resource ); |
||
184 | } |
||
185 | |||
186 | |||
187 | /** |
||
188 | * Returns a PSR-7 request object for the current request |
||
189 | * |
||
190 | * @return \Psr\Http\Message\ServerRequestInterface PSR-7 request object |
||
191 | */ |
||
192 | protected function getPsrRequest() |
||
212 | |||
213 | |||
214 | /** |
||
215 | * Set the response data from a PSR-7 response object |
||
216 | * |
||
217 | * @param \Psr\Http\Message\ResponseInterface $response PSR-7 response object |
||
218 | * @return string Response message content |
||
219 | */ |
||
220 | protected function setPsrResponse( \Psr\Http\Message\ResponseInterface $response ) |
||
230 | } |
||
231 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.