CoreFiles by mySites.guru
helper.php55 lines, 1,138 bytes, from Joomla_4.0.0-alpha12-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha11
md5
8b82cdf4a022bab8f75daddca9d92b25
sha1
595dd829f880380339cc0c6c087792acee7b7709
sha256
0ef0f131693259155e55401decf29e47819cc68f930923044d836e1ce5622895
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  mod_privacy_dashboard
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

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

/**
 * Helper class for admin privacy dashboard module
 *
 * @since  3.9.0
 */
class ModPrivacyDashboardHelper
{
	/**
	 * 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 [];
		}
	}
}

No other release has this exact content. See every version of this file.