1: <?php
2:
3: namespace LaravelUi5\Core\Controllers;
4:
5: use Flat3\Lodata\Controller\Request;
6: use Flat3\Lodata\Controller\Response;
7: use Flat3\Lodata\Controller\Transaction;
8:
9: /**
10: * OData Entry Point for UI5
11: *
12: * This controller handles incoming OData requests from OpenUI5 clients.
13: *
14: * The OData specification allows for asynchronous processing via the
15: * `Prefer: respond-async` header (RFC 7240). However, OpenUI5 does not
16: * support or expect this behavior and always relies on immediate, synchronous
17: * responses to its OData requests.
18: *
19: * Therefore, this controller intentionally omits support for `respond-async`
20: * and executes all transactions directly.
21: *
22: * @see Flat3\Lodata\Controller\OData
23: */
24: class ODataController
25: {
26: /**
27: * Handle an OData request
28: * @param Request $request The request
29: * @param Transaction $transaction Injected transaction
30: * @return Response Client response
31: */
32: public function __invoke(Request $request, Transaction $transaction): Response
33: {
34: $transaction->initialize($request);
35:
36: return $transaction->execute();
37: }
38: }
39: