[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/api/components/com_plugins/src/View/Plugins/ -> JsonapiView.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.API
   5   * @subpackage  com_plugins
   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  
  11  namespace Joomla\Component\Plugins\Api\View\Plugins;
  12  
  13  use Joomla\CMS\MVC\View\JsonApiView as BaseApiView;
  14  
  15  // phpcs:disable PSR1.Files.SideEffects
  16  \defined('_JEXEC') or die;
  17  // phpcs:enable PSR1.Files.SideEffects
  18  
  19  /**
  20   * The plugins view
  21   *
  22   * @since  4.0.0
  23   */
  24  class JsonapiView extends BaseApiView
  25  {
  26      /**
  27       * The fields to render item in the documents
  28       *
  29       * @var  array
  30       * @since  4.0.0
  31       */
  32      protected $fieldsToRenderItem = [
  33          'id',
  34          'name',
  35          'type',
  36          'element',
  37          'changelogurl',
  38          'folder',
  39          'client_id',
  40          'enabled',
  41          'access',
  42          'protected',
  43          'checked_out',
  44          'checked_out_time',
  45          'ordering',
  46          'state',
  47      ];
  48  
  49      /**
  50       * The fields to render items in the documents
  51       *
  52       * @var  array
  53       * @since  4.0.0
  54       */
  55      protected $fieldsToRenderList = [
  56          'id',
  57          'name',
  58          'element',
  59          'folder',
  60          'checked_out',
  61          'checked_out_time',
  62          'enabled',
  63          'access',
  64          'ordering',
  65          'editor',
  66          'access_level',
  67      ];
  68  
  69      /**
  70       * Prepare item before render.
  71       *
  72       * @param   object  $item  The model item
  73       *
  74       * @return  object
  75       *
  76       * @since   4.0.0
  77       */
  78      protected function prepareItem($item)
  79      {
  80          $item->id = $item->extension_id;
  81          unset($item->extension_id);
  82  
  83          return $item;
  84      }
  85  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer