CoreFiles by mySites.guru
LevelsController.php59 lines, 1,295 bytes, from Joomla_6.2.0-beta1-Beta-Full_Package.zip
Raw History Compare with 6.1.0-beta3
md5
c7a4b9a49a3f47b4768875644b0da020
sha1
99fb7420917e38b46628c4004084b020b7932d08
sha256
e1e592e74990f5f505d3770230a4bf704028a830e6b63d46e610b23ce1ee7c65
<?php

/**
 * @package     Joomla.API
 * @subpackage  com_users
 *
 * @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\Users\Api\Controller;

use Joomla\CMS\MVC\Controller\ApiController;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * The levels controller
 *
 * @since  4.0.0
 */
class LevelsController extends ApiController
{
    /**
     * The content type of the item.
     *
     * @var    string
     * @since  4.0.0
     */
    protected $contentType = 'levels';

    /**
     * The default view for the display method.
     *
     * @var    string
     * @since  4.0.0
     */
    protected $default_view = 'levels';

    /**
     * Method to allow extended classes to manipulate the data to be saved for an extension.
     *
     * @param   array  $data  An array of input data.
     *
     * @return  array
     *
     * @since   6.2.0
     */
    protected function preprocessSaveData(array $data): array
    {
        if ($this->input->getMethod() === 'PATCH') {
            $data['rules'] = json_decode($data['rules'], true);
        }

        return $data;
    }
}

The same content is in 5 releases, Joomla 6.2.0-alpha2 to 6.2.0-beta3. See them all, or every version of this file.