CoreFiles by mySites.guru
LevelsController.php59 lines, 1,295 bytes, from Joomla_6.1.2-rc1-Release_Candidate-Full_Package.zip
Raw History Compare with 6.1.1-rc1
md5
f115474283aeb6933748bc1afa9b9dd3
sha1
0a71f3a1f738a9b8db02692adab4c558e91a72bf
sha256
ed59e0f6c55204f98518243ca5635a77795ed3035ec10d7d7530e2ab4cb314e1
<?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.1.2
     */
    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 8 releases, Joomla 6.1.2-rc1 to 6.1.4-rc1. See them all, or every version of this file.