2022-07-11 08:59:32 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Wrm\Events\Events\Controller;
|
|
|
|
|
2022-08-02 17:15:47 +02:00
|
|
|
use TYPO3\CMS\Core\Pagination\PaginationInterface;
|
2022-07-11 08:59:32 +02:00
|
|
|
use TYPO3\CMS\Extbase\Persistence\Generic\QueryResult;
|
|
|
|
use Wrm\Events\Domain\Model\Date;
|
|
|
|
use Wrm\Events\Domain\Model\Dto\DateDemand;
|
|
|
|
|
|
|
|
final class DateListVariables
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
private $search;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var DateDemand
|
|
|
|
*/
|
|
|
|
private $demand;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var QueryResult<Date>
|
|
|
|
*/
|
|
|
|
private $dates;
|
|
|
|
|
2022-08-02 17:15:47 +02:00
|
|
|
/**
|
|
|
|
* @var PaginationInterface
|
|
|
|
*/
|
|
|
|
private $pagination;
|
|
|
|
|
2022-07-11 08:59:32 +02:00
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
private $variables = [];
|
|
|
|
|
|
|
|
public function __construct(
|
|
|
|
array $search,
|
|
|
|
DateDemand $demand,
|
2022-08-02 17:15:47 +02:00
|
|
|
QueryResult $dates,
|
|
|
|
PaginationInterface $pagination
|
2022-07-11 08:59:32 +02:00
|
|
|
) {
|
|
|
|
$this->search = $search;
|
|
|
|
$this->demand = $demand;
|
|
|
|
$this->dates = $dates;
|
2022-08-02 17:15:47 +02:00
|
|
|
$this->pagination = $pagination;
|
2022-07-11 08:59:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getSearch(): array
|
|
|
|
{
|
|
|
|
return $this->search;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getDemand(): DateDemand
|
|
|
|
{
|
|
|
|
return $this->demand;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return QueryResult<Date>
|
|
|
|
*/
|
|
|
|
public function getDates(): QueryResult
|
|
|
|
{
|
|
|
|
return $this->dates;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $value
|
|
|
|
*/
|
|
|
|
public function addVariable(string $key, $value): void
|
|
|
|
{
|
|
|
|
$this->variables[$key] = $value;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getVariablesForView(): array
|
|
|
|
{
|
|
|
|
return array_merge([
|
|
|
|
'search' => $this->search,
|
|
|
|
'demand' => $this->demand,
|
|
|
|
'dates' => $this->dates,
|
2022-08-02 17:15:47 +02:00
|
|
|
'pagination' => $this->pagination,
|
2022-07-11 08:59:32 +02:00
|
|
|
], $this->variables);
|
|
|
|
}
|
|
|
|
}
|