*/ private $regions; /** * @var array */ private $categories; /** * @var array */ private $features; /** * @var array */ private $variables = []; /** * @param QueryResultInterface $regions */ public function __construct( array $search, DateDemand $demand, QueryResultInterface $regions, array $categories, array $features ) { $this->search = $search; $this->demand = $demand; $this->regions = $regions; $this->categories = $categories; $this->features = $features; } public function getSearch(): array { return $this->search; } public function getDemand(): DateDemand { return $this->demand; } /** * @return QueryResultInterface */ public function getRegions(): QueryResultInterface { return $this->regions; } public function getCategories(): array { return $this->categories; } public function getFeatures(): array { return $this->features; } /** * @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, 'regions' => $this->regions, 'categories' => $this->categories, 'features' => $this->features, ], $this->variables); } }