CoreFiles by mySites.guru
PrivacyDashboardHelper.php57 lines, 1,459 bytes, from Joomla_4.3.2-Stable-Full_Package.zip
Raw History Compare with 4.3.1
md5
90a3eea6ba3a8f9278f95853a47f1158
sha1
529f80dcd1c245f0c23dec79fc85fc50f6c78d80
sha256
412cc11d4a0d90b47b2aa330bdb75dc0be8dfadee919d00b97d356439f2c1eb5
<?php

/**
 * @package     Joomla.Administrator
 * @subpackage  mod_privacy_dashboard
 *
 * @copyright   (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Module\PrivacyDashboard\Administrator\Helper;

use Joomla\CMS\Factory;
use Joomla\Database\Exception\ExecutionFailureException;

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

/**
 * Helper class for admin privacy dashboard module
 *
 * @since  3.9.0
 */
class PrivacyDashboardHelper
{
    /**
     * Method to retrieve information about the site privacy requests
     *
     * @return  array  Array containing site privacy requests
     *
     * @since   3.9.0
     */
    public static function getData()
    {
        $db    = Factory::getDbo();
        $query = $db->getQuery(true)
            ->select(
                [
                    'COUNT(*) AS count',
                    $db->quoteName('status'),
                    $db->quoteName('request_type'),
                ]
            )
            ->from($db->quoteName('#__privacy_requests'))
            ->group($db->quoteName('status'))
            ->group($db->quoteName('request_type'));

        $db->setQuery($query);

        try {
            return $db->loadObjectList();
        } catch (ExecutionFailureException $e) {
            return [];
        }
    }
}

The same content is in 132 releases, Joomla 4.2.1 to 5.3.0-beta1. See them all, or every version of this file.