- md5
- b263b0d65487c02934b11a09ad5e4eb7
- sha1
- 2409707ddb9aa761ff22bcd55430d29f8b5a8c3c
- sha256
- d81b58ed84f87ab0cc3bee8360ec7ea177a1bce1b160586d909b6c323f5bb1ad
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
<?php
/**
* @package Joomla.API
* @subpackage com_privacy
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Privacy\Api\Controller;
\defined('_JEXEC') or die;
use Joomla\CMS\MVC\Controller\ApiController;
use Joomla\Component\Privacy\Api\View\Requests\JsonapiView;
/**
* The requests controller
*
* @since 4.0.0
*/
class RequestsController extends ApiController
{
/**
* The content type of the item.
*
* @var string
* @since 4.0.0
*/
protected $contentType = 'requests';
/**
* The default view for the display method.
*
* @var string
* @since 3.0
*/
protected $default_view = 'requests';
/**
* Export request data
*
* @param integer $id The primary key to display. Leave empty if you want to retrieve data from the request
*
* @return static A \JControllerLegacy object to support chaining.
*
* @since 4.0.0
*/
public function export($id = null)
{
if ($id === null)
{
$id = $this->input->get('id', 0, 'int');
}
$viewType = $this->app->getDocument()->getType();
$viewName = $this->input->get('view', $this->default_view);
$viewLayout = $this->input->get('layout', 'default', 'string');
try
{
/** @var JsonapiView $view */
$view = $this->getView(
$viewName,
$viewType,
'',
['base_path' => $this->basePath, 'layout' => $viewLayout, 'contentType' => $this->contentType]
);
}
catch (\Exception $e)
{
throw new \RuntimeException($e->getMessage());
}
$model = $this->getModel('export');
try
{
$modelName = $model->getName();
}
catch (\Exception $e)
{
throw new \RuntimeException($e->getMessage());
}
$model->setState($modelName . '.request_id', $id);
$view->setModel($model, true);
$view->document = $this->app->getDocument();
$view->export();
return $this;
}
}
The same content is in 5 releases, Joomla 4.0.0-beta to 4.0.0-beta5. See them all, or every version of this file.