CoreFiles by mySites.guru
LevelsController.php59 lines, 1,295 bytes, from Joomla_5.4.8-Stable-Full_Package.zip
Raw History Compare with 5.4.7
md5
6912c2df4610cc10ef8012142c6bb427
sha1
492cb6489f77b7901d01f872edf9258a93d1cbcb
sha256
eec24bb2a0d2260aef9364ba4328da0056feef9012e22b01e5aa6f52214e3bde
<?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   5.4.7
     */
    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 6 releases, Joomla 5.4.7-rc1 to 5.4.9-rc1. See them all, or every version of this file.