mirror of
https://github.com/werkraum-media/events.git
synced 2024-11-22 14:56:11 +01:00
Expose settings via DateSearchVariables
Event (#57)
This commit is contained in:
parent
9498fec755
commit
275dc3ffc1
5 changed files with 84 additions and 1 deletions
|
@ -133,6 +133,7 @@ class DateController extends AbstractController
|
||||||
}
|
}
|
||||||
|
|
||||||
$event = $this->eventDispatcher->dispatch(new DateSearchVariables(
|
$event = $this->eventDispatcher->dispatch(new DateSearchVariables(
|
||||||
|
$this->settings,
|
||||||
$search,
|
$search,
|
||||||
$demand,
|
$demand,
|
||||||
$this->regionRepository->findAll(),
|
$this->regionRepository->findAll(),
|
||||||
|
|
|
@ -9,6 +9,11 @@ use Wrm\Events\Domain\Model\Region;
|
||||||
|
|
||||||
class DateSearchVariables
|
class DateSearchVariables
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
private $settings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
|
@ -43,12 +48,14 @@ class DateSearchVariables
|
||||||
* @param QueryResultInterface<Region> $regions
|
* @param QueryResultInterface<Region> $regions
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
|
array $settings,
|
||||||
array $search,
|
array $search,
|
||||||
DateDemand $demand,
|
DateDemand $demand,
|
||||||
QueryResultInterface $regions,
|
QueryResultInterface $regions,
|
||||||
array $categories,
|
array $categories,
|
||||||
array $features
|
array $features
|
||||||
) {
|
) {
|
||||||
|
$this->settings = $settings;
|
||||||
$this->search = $search;
|
$this->search = $search;
|
||||||
$this->demand = $demand;
|
$this->demand = $demand;
|
||||||
$this->regions = $regions;
|
$this->regions = $regions;
|
||||||
|
@ -56,6 +63,11 @@ class DateSearchVariables
|
||||||
$this->features = $features;
|
$this->features = $features;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSettings(): array
|
||||||
|
{
|
||||||
|
return $this->settings;
|
||||||
|
}
|
||||||
|
|
||||||
public function getSearch(): array
|
public function getSearch(): array
|
||||||
{
|
{
|
||||||
return $this->search;
|
return $this->search;
|
||||||
|
|
27
Documentation/Changelog/3.8.0.rst
Normal file
27
Documentation/Changelog/3.8.0.rst
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
3.8.0
|
||||||
|
=====
|
||||||
|
|
||||||
|
Breaking
|
||||||
|
--------
|
||||||
|
|
||||||
|
Nothing
|
||||||
|
|
||||||
|
Features
|
||||||
|
--------
|
||||||
|
|
||||||
|
* Expose settings via `DateSearchVariables` Event.
|
||||||
|
|
||||||
|
Fixes
|
||||||
|
-----
|
||||||
|
|
||||||
|
Nothing
|
||||||
|
|
||||||
|
Tasks
|
||||||
|
-----
|
||||||
|
|
||||||
|
Nothing
|
||||||
|
|
||||||
|
Deprecation
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Nothing
|
|
@ -23,6 +23,8 @@ class DateSearchVariablesTest extends TestCase
|
||||||
public function canBeCreated(): void
|
public function canBeCreated(): void
|
||||||
{
|
{
|
||||||
$subject = new DateSearchVariables(
|
$subject = new DateSearchVariables(
|
||||||
|
[
|
||||||
|
],
|
||||||
[
|
[
|
||||||
],
|
],
|
||||||
new DateDemand(),
|
new DateDemand(),
|
||||||
|
@ -37,12 +39,39 @@ class DateSearchVariablesTest extends TestCase
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function returnsInitializeSettings(): void
|
||||||
|
{
|
||||||
|
$subject = new DateSearchVariables(
|
||||||
|
[
|
||||||
|
'someCustomKey' => 'someCustomValue',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
],
|
||||||
|
new DateDemand(),
|
||||||
|
$this->prophesize(QueryResult::class)->reveal(),
|
||||||
|
[],
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
|
||||||
|
self::assertSame(
|
||||||
|
[
|
||||||
|
'someCustomKey' => 'someCustomValue',
|
||||||
|
],
|
||||||
|
$subject->getSettings()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @test
|
* @test
|
||||||
*/
|
*/
|
||||||
public function returnsInitializeSearch(): void
|
public function returnsInitializeSearch(): void
|
||||||
{
|
{
|
||||||
$subject = new DateSearchVariables(
|
$subject = new DateSearchVariables(
|
||||||
|
[
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'executed' => '1',
|
'executed' => '1',
|
||||||
],
|
],
|
||||||
|
@ -67,6 +96,8 @@ class DateSearchVariablesTest extends TestCase
|
||||||
{
|
{
|
||||||
$demand = new DateDemand();
|
$demand = new DateDemand();
|
||||||
$subject = new DateSearchVariables(
|
$subject = new DateSearchVariables(
|
||||||
|
[
|
||||||
|
],
|
||||||
[
|
[
|
||||||
],
|
],
|
||||||
$demand,
|
$demand,
|
||||||
|
@ -88,6 +119,8 @@ class DateSearchVariablesTest extends TestCase
|
||||||
{
|
{
|
||||||
$regions = $this->prophesize(QueryResult::class)->reveal();
|
$regions = $this->prophesize(QueryResult::class)->reveal();
|
||||||
$subject = new DateSearchVariables(
|
$subject = new DateSearchVariables(
|
||||||
|
[
|
||||||
|
],
|
||||||
[
|
[
|
||||||
],
|
],
|
||||||
new DateDemand(),
|
new DateDemand(),
|
||||||
|
@ -108,6 +141,8 @@ class DateSearchVariablesTest extends TestCase
|
||||||
public function returnsInitialCategories(): void
|
public function returnsInitialCategories(): void
|
||||||
{
|
{
|
||||||
$subject = new DateSearchVariables(
|
$subject = new DateSearchVariables(
|
||||||
|
[
|
||||||
|
],
|
||||||
[
|
[
|
||||||
],
|
],
|
||||||
new DateDemand(),
|
new DateDemand(),
|
||||||
|
@ -132,6 +167,8 @@ class DateSearchVariablesTest extends TestCase
|
||||||
public function returnsInitialFeatures(): void
|
public function returnsInitialFeatures(): void
|
||||||
{
|
{
|
||||||
$subject = new DateSearchVariables(
|
$subject = new DateSearchVariables(
|
||||||
|
[
|
||||||
|
],
|
||||||
[
|
[
|
||||||
],
|
],
|
||||||
new DateDemand(),
|
new DateDemand(),
|
||||||
|
@ -159,6 +196,8 @@ class DateSearchVariablesTest extends TestCase
|
||||||
$demand = new DateDemand();
|
$demand = new DateDemand();
|
||||||
$regions = $this->prophesize(QueryResult::class)->reveal();
|
$regions = $this->prophesize(QueryResult::class)->reveal();
|
||||||
$subject = new DateSearchVariables(
|
$subject = new DateSearchVariables(
|
||||||
|
[
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'executed' => '1',
|
'executed' => '1',
|
||||||
],
|
],
|
||||||
|
@ -198,6 +237,8 @@ class DateSearchVariablesTest extends TestCase
|
||||||
$demand = new DateDemand();
|
$demand = new DateDemand();
|
||||||
$regions = $this->prophesize(QueryResult::class)->reveal();
|
$regions = $this->prophesize(QueryResult::class)->reveal();
|
||||||
$subject = new DateSearchVariables(
|
$subject = new DateSearchVariables(
|
||||||
|
[
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'executed' => '1',
|
'executed' => '1',
|
||||||
],
|
],
|
||||||
|
@ -242,6 +283,8 @@ class DateSearchVariablesTest extends TestCase
|
||||||
$demand = new DateDemand();
|
$demand = new DateDemand();
|
||||||
$regions = $this->prophesize(QueryResult::class)->reveal();
|
$regions = $this->prophesize(QueryResult::class)->reveal();
|
||||||
$subject = new DateSearchVariables(
|
$subject = new DateSearchVariables(
|
||||||
|
[
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'executed' => '1',
|
'executed' => '1',
|
||||||
],
|
],
|
||||||
|
|
|
@ -9,7 +9,7 @@ $EM_CONF['events'] = [
|
||||||
'state' => 'stable',
|
'state' => 'stable',
|
||||||
'createDirs' => '',
|
'createDirs' => '',
|
||||||
'clearCacheOnLoad' => 0,
|
'clearCacheOnLoad' => 0,
|
||||||
'version' => '3.7.0',
|
'version' => '3.8.0',
|
||||||
'constraints' => [
|
'constraints' => [
|
||||||
'depends' => [
|
'depends' => [
|
||||||
'typo3' => '10.4.00-11.5.99',
|
'typo3' => '10.4.00-11.5.99',
|
||||||
|
|
Loading…
Reference in a new issue