PluginProbe
The Innovative Form Builder – IvyForms / 1.5
The Innovative Form Builder – IvyForms v1.5
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
← All changes | backend/src/Controllers/Entry/GetEntryController.php +6 -7 0.6 → 1.5 View file →
@@ -1,23 +1,19 @@
1 1 <?php
2 2
3 3 /**
4 - * @copyright © TMS-Plugins. All rights reserved.
4 + * @copyright © Melograno Venture Studio. All rights reserved.
5 5 * @licence See COPYING.md for license details.
6 6 */
7 7
8 8 namespace IvyForms\Controllers\Entry;
9 9
10 -// phpcs:disable PSR1.Files.SideEffects
11 -if (!defined('ABSPATH')) {
12 - exit; // Exit if accessed directly
13 -}
14 -
15 10 use IvyForms\Common\Exceptions\ForbiddenException;
16 11 use IvyForms\Common\Exceptions\InvalidArgumentException;
17 12 use IvyForms\Common\Exceptions\NotFoundException;
18 13 use IvyForms\Common\Sanitizer\Sanitizer;
19 14 use IvyForms\Controllers\Controller;
15 +use IvyForms\Services\Amelia\AmeliaService;
20 16 use IvyForms\Services\Entry\EntryService;
21 17 use IvyForms\Services\Translations\BackendStrings;
22 18 use WP_REST_Request;
23 19 use WP_REST_Response;
@@ -29,12 +25,14 @@
29 25 */
30 26 class GetEntryController extends Controller
31 27 {
32 28 private EntryService $entryService;
29 + private AmeliaService $ameliaService;
33 30
34 - public function __construct(EntryService $entryService)
31 + public function __construct(EntryService $entryService, AmeliaService $ameliaService)
35 32 {
36 33 $this->entryService = $entryService;
34 + $this->ameliaService = $ameliaService;
37 35 }
38 36
39 37 /**
40 38 * @param WP_REST_Request $data
@@ -59,8 +57,9 @@
59 57 $entryId = Sanitizer::sanitizeId($data->get_param('id'));
60 58
61 59 $entry = $this->entryService->getEntryManager()->getEntry($entryId);
62 60 $entryArray = $entry->toArray();
61 + $entryArray['ameliaBookingUrls'] = $this->ameliaService->getBookingUrlsByEntryId($entryId);
63 62
64 63 $entryFields = $this->entryService->getEntryFieldManager()->getEntryFields([$entryArray]);
65 64
66 65 return new WP_REST_Response([