- md5
- a0fe6a79161d0369db9e82636774832f
- sha1
- 294ab0f2aa04db69797481bf2edc44388c23d30a
- sha256
- 5ec2e44758d8b821d11e6489b3b3aa8db03fe1c46a020f2c6aed6ac62904923e
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
<?php
/**
* @package Joomla.API
* @subpackage com_media
*
* @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Media\Api\View\Media;
\defined('_JEXEC') or die;
use Joomla\CMS\MVC\View\JsonApiView as BaseApiView;
use Joomla\Component\Media\Administrator\Provider\ProviderManagerHelperTrait;
/**
* Media web service view
*
* @since 4.1.0
*/
class JsonapiView extends BaseApiView
{
use ProviderManagerHelperTrait;
/**
* The fields to render item in the documents
*
* @var array
* @since 4.1.0
*/
protected $fieldsToRenderItem = [
'type',
'name',
'path',
'extension',
'size',
'mime_type',
'width',
'height',
'create_date',
'create_date_formatted',
'modified_date',
'modified_date_formatted',
'thumb_path',
'adapter',
'content',
'url',
'tempUrl',
];
/**
* The fields to render items in the documents
*
* @var array
* @since 4.1.0
*/
protected $fieldsToRenderList = [
'type',
'name',
'path',
'extension',
'size',
'mime_type',
'width',
'height',
'create_date',
'create_date_formatted',
'modified_date',
'modified_date_formatted',
'thumb_path',
'adapter',
'content',
'url',
'tempUrl',
];
/**
* Prepare item before render.
*
* @param object $item The model item
*
* @return object
*
* @since 4.1.0
*/
protected function prepareItem($item)
{
// Media resources have no id.
$item->id = '0';
return $item;
}
}
The same content is in 32 releases, Joomla 4.1.0-rc1 to 4.2.5-rc1. See them all, or every version of this file.