35 lines
1002 B
PHP
35 lines
1002 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace HermannTelser\Watten\Tca;
|
|
|
|
use TYPO3\CMS\Core\Database\ConnectionPool;
|
|
use TYPO3\CMS\Core\Database\Connection;
|
|
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
|
|
|
class Configuration
|
|
{
|
|
/*
|
|
* @param string $type
|
|
* @return integer
|
|
*/
|
|
public static function eingabedatum(): int
|
|
{
|
|
// use last entry in ergebnisse as default
|
|
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tx_watten_domain_model_ergebnisse')->createQueryBuilder();
|
|
$res = $queryBuilder
|
|
->select('datum')
|
|
->from('tx_watten_domain_model_ergebnisse')
|
|
->addOrderBy('uid', 'DESC')
|
|
->setMaxResults(1)
|
|
->setFirstResult(0)
|
|
->execute();
|
|
$spieltag = 0;
|
|
foreach ($res as $key => $value) {
|
|
$spieltag = (int) $value['datum'];
|
|
}
|
|
return $spieltag;
|
|
}
|
|
}
|