39 lines
981 B
PHP
39 lines
981 B
PHP
|
<?php
|
||
|
|
||
|
declare(strict_types=1);
|
||
|
|
||
|
|
||
|
namespace WapplerSystems\BookmarksLikesRatings\Widgets\Provider;
|
||
|
|
||
|
use TYPO3\CMS\Core\Database\Connection;
|
||
|
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||
|
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
|
||
|
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||
|
use TYPO3\CMS\Dashboard\Widgets\ListDataProviderInterface;
|
||
|
|
||
|
class TopLikesDataProvider implements ListDataProviderInterface
|
||
|
{
|
||
|
|
||
|
|
||
|
public function __construct()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
|
||
|
public function getItems(): array
|
||
|
{
|
||
|
/** @var QueryBuilder $queryBuilder */
|
||
|
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('be_users');
|
||
|
return $queryBuilder
|
||
|
->count('*')
|
||
|
->from('be_users')
|
||
|
->where(
|
||
|
$queryBuilder->expr()->eq(
|
||
|
'admin',
|
||
|
$queryBuilder->createNamedParameter(0, Connection::PARAM_INT)
|
||
|
)
|
||
|
)
|
||
|
->execute();
|
||
|
}
|
||
|
}
|