[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * @package Joomla.Privacy 5 * @subpackage Webservices.Privacy 6 * 7 * @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org> 8 * @license GNU General Public License version 2 or later; see LICENSE.txt 9 10 * @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace 11 */ 12 13 use Joomla\CMS\Plugin\CMSPlugin; 14 use Joomla\CMS\Router\ApiRouter; 15 use Joomla\Router\Route; 16 17 // phpcs:disable PSR1.Files.SideEffects 18 \defined('_JEXEC') or die; 19 // phpcs:enable PSR1.Files.SideEffects 20 21 /** 22 * Web Services adapter for com_privacy. 23 * 24 * @since 4.0.0 25 */ 26 class PlgWebservicesPrivacy extends CMSPlugin 27 { 28 /** 29 * Load the language file on instantiation. 30 * 31 * @var boolean 32 * @since 4.0.0 33 */ 34 protected $autoloadLanguage = true; 35 36 /** 37 * Registers com_privacy's API's routes in the application 38 * 39 * @param ApiRouter &$router The API Routing object 40 * 41 * @return void 42 * 43 * @since 4.0.0 44 */ 45 public function onBeforeApiRoute(&$router) 46 { 47 $defaults = ['component' => 'com_privacy']; 48 $getDefaults = array_merge(['public' => false], $defaults); 49 50 $routes = [ 51 new Route(['GET'], 'v1/privacy/requests', 'requests.displayList', [], $getDefaults), 52 new Route(['GET'], 'v1/privacy/requests/:id', 'requests.displayItem', ['id' => '(\d+)'], $getDefaults), 53 new Route(['GET'], 'v1/privacy/requests/export/:id', 'requests.export', ['id' => '(\d+)'], $getDefaults), 54 new Route(['POST'], 'v1/privacy/requests', 'requests.add', [], $defaults), 55 ]; 56 57 $router->addRoutes($routes); 58 59 $routes = [ 60 new Route(['GET'], 'v1/privacy/consents', 'consents.displayList', [], $getDefaults), 61 new Route(['GET'], 'v1/privacy/consents/:id', 'consents.displayItem', ['id' => '(\d+)'], $getDefaults), 62 new Route(['DELETE'], 'v1/privacy/consents/:id', 'consents.delete', ['id' => '(\d+)'], $defaults), 63 ]; 64 65 $router->addRoutes($routes); 66 } 67 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |