Restore point before Stufe 3 (central resolver-service refactoring). Includes this session's work: - Success Story (usecase) rebuild: new fields/tabs, UsecaseSerializer, thin List/Show renderers, MM relations, inline content elements. - vitec_columns content block (two-column layout with per-item content) incl. unified header section; special-cased JSON resolution. - Container per-column flex (items[].config align/justify) + gap on parent. - Unified header section across CEs/plugins/containers; header fields in JSON. - ISO-style architecture spec: Documentation/Headless-JSON-Architecture.md. - Cleanup: removed local scratch + verified .bak backups. - Fixes: B-6 (undefined thumbnail variable in Downloadcardcollection image resolver), B-7 (unsatisfiable legacy CType OR branch in Downloadcard/Datasheets). Rollback: git reset --hard snapshot-2026-07-09-pre-stufe3 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
72 lines
2.2 KiB
PHP
72 lines
2.2 KiB
PHP
<?php
|
|
|
|
namespace Evomedien\Vitec\Domain\Repository;
|
|
|
|
use TYPO3\CMS\Extbase\Persistence\QueryInterface;
|
|
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
|
|
use TYPO3\CMS\Extbase\Persistence\Repository;
|
|
|
|
/**
|
|
* The repository for Event
|
|
*/
|
|
class EventRepository extends Repository
|
|
{
|
|
protected $defaultOrderings = [
|
|
'eventstart' => QueryInterface::ORDER_ASCENDING,
|
|
];
|
|
|
|
/**
|
|
* All upcoming (or currently running) events, soonest first.
|
|
* "Upcoming" = event end (or start, when no end is set) is today or later.
|
|
*/
|
|
public function findUpcoming(): QueryResultInterface
|
|
{
|
|
$todayMidnight = strtotime('today');
|
|
|
|
$query = $this->createQuery();
|
|
$query->getQuerySettings()->setRespectStoragePage(false);
|
|
$query->matching(
|
|
$query->logicalAnd(
|
|
$query->equals('hideonwebsite', 0),
|
|
$query->logicalOr(
|
|
$query->greaterThanOrEqual('eventend', $todayMidnight),
|
|
$query->logicalAnd(
|
|
$query->equals('eventend', 0),
|
|
$query->greaterThanOrEqual('eventstart', $todayMidnight)
|
|
)
|
|
)
|
|
)
|
|
);
|
|
return $query->execute();
|
|
}
|
|
|
|
/**
|
|
* Past events, most recent first.
|
|
*/
|
|
public function findPast(): QueryResultInterface
|
|
{
|
|
$todayMidnight = strtotime('today');
|
|
|
|
$query = $this->createQuery();
|
|
$query->getQuerySettings()->setRespectStoragePage(false);
|
|
$query->matching(
|
|
$query->logicalAnd(
|
|
$query->equals('hideonwebsite', 0),
|
|
$query->logicalOr(
|
|
$query->logicalAnd(
|
|
$query->greaterThan('eventend', 0),
|
|
$query->lessThan('eventend', $todayMidnight)
|
|
),
|
|
$query->logicalAnd(
|
|
$query->equals('eventend', 0),
|
|
$query->greaterThan('eventstart', 0),
|
|
$query->lessThan('eventstart', $todayMidnight)
|
|
)
|
|
)
|
|
)
|
|
);
|
|
$query->setOrderings(['eventstart' => QueryInterface::ORDER_DESCENDING]);
|
|
return $query->execute();
|
|
}
|
|
}
|