-
-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[!!!][FEATURE] Migrate VariantIdModifier hook to PSR-14 event
The hook `$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['modifyVariantId']` is migrated to a new PSR-14 event `ApacheSolrForTypo3\Solr\Event\Variants\AfterVariantIdWasBuiltEvent` Documentation is updated.
- Loading branch information
Showing
8 changed files
with
121 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
namespace ApacheSolrForTypo3\Solr\Event\Variants; | ||
|
||
use ApacheSolrForTypo3\Solr\Domain\Site\Site; | ||
use ApacheSolrForTypo3\Solr\System\Solr\Document\Document; | ||
|
||
/** | ||
* Event which is fired after the ID (string) for a variant was created. | ||
* | ||
* Previously used with $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['solr']['modifyVariantId'] | ||
* and the ApacheSolrForTypo3\Solr\Domain\Variants\IdModifier interface. | ||
*/ | ||
final class AfterVariantIdWasBuiltEvent | ||
{ | ||
public function __construct( | ||
private string $variantId, | ||
private readonly string $systemHash, | ||
private readonly string $type, | ||
private readonly int $uid, | ||
private readonly array $itemRecord, | ||
private readonly Site $site, | ||
private readonly Document $document | ||
) { | ||
} | ||
|
||
public function getVariantId(): string | ||
{ | ||
return $this->variantId; | ||
} | ||
|
||
public function setVariantId(string $variantId): void | ||
{ | ||
$this->variantId = $variantId; | ||
} | ||
|
||
public function getSystemHash(): string | ||
{ | ||
return $this->systemHash; | ||
} | ||
|
||
public function getType(): string | ||
{ | ||
return $this->type; | ||
} | ||
|
||
public function getUid(): int | ||
{ | ||
return $this->uid; | ||
} | ||
|
||
public function getItemRecord(): array | ||
{ | ||
return $this->itemRecord; | ||
} | ||
|
||
public function getSite(): Site | ||
{ | ||
return $this->site; | ||
} | ||
|
||
public function getDocument(): Document | ||
{ | ||
return $this->document; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters