- md5
- d095239ca085b70d83a6cb89e9d29ad2
- sha1
- a888fee2ffe2b4ab66caf43550f27a7261310768
- sha256
- c018168eedbf28993d6fbcb4b56b01fed3fc7a2c9e7d41030468d9fe460e087a
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
<?php
/**
* @package Joomla.API
* @subpackage com_fields
*
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Fields\Api\View\Groups;
use Joomla\CMS\MVC\View\JsonApiView as BaseApiView;
use Joomla\CMS\Router\Exception\RouteNotFoundException;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* The groups view
*
* @since 4.0.0
*/
class JsonapiView extends BaseApiView
{
/**
* The fields to render item in the documents
*
* @var array
* @since 4.0.0
*/
protected $fieldsToRenderItem = [
'typeAlias',
'id',
'asset_id',
'context',
'title',
'note',
'description',
'state',
'checked_out',
'checked_out_time',
'ordering',
'params',
'language',
'created',
'created_by',
'modified',
'modified_by',
'access',
'type',
];
/**
* The fields to render items in the documents
*
* @var array
* @since 4.0.0
*/
protected $fieldsToRenderList = [
'id',
'title',
'name',
'checked_out',
'checked_out_time',
'note',
'state',
'access',
'created_time',
'created_user_id',
'ordering',
'language',
'fieldparams',
'params',
'type',
'default_value',
'context',
'group_id',
'label',
'description',
'required',
'language_title',
'language_image',
'editor',
'access_level',
'author_name',
'group_title',
'group_access',
'group_state',
'group_note',
];
/**
* Execute and display a template script.
*
* @param object $item Item
*
* @return string
*
* @since 4.0.0
*/
public function displayItem($item = null)
{
if ($item === null) {
/** @var \Joomla\CMS\MVC\Model\AdminModel $model */
$model = $this->getModel();
$item = $this->prepareItem($model->getItem());
}
if ($item->id === null) {
throw new RouteNotFoundException('Item does not exist');
}
if ($item->context != $this->getModel()->getState('filter.context')) {
throw new RouteNotFoundException('Item does not exist');
}
return parent::displayItem($item);
}
}
The same content is in 224 releases, Joomla 4.2.1 to 6.2.0. See them all, or every version of this file.