-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IBX-7299: Added event emission to allow modification of content type …
…list (#1054)
- Loading branch information
Showing
2 changed files
with
82 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\AdminUi\Event; | ||
|
||
use Symfony\Contracts\EventDispatcher\Event; | ||
|
||
/** | ||
* @phpstan-import-type TContentTypeData from \Ibexa\AdminUi\UI\Config\Provider\ContentTypes | ||
*/ | ||
final class FilterContentTypesEvent extends Event | ||
{ | ||
/** @var array<string, array<TContentTypeData>> */ | ||
private array $contentTypeGroups; | ||
|
||
/** | ||
* @param array<string, array<TContentTypeData>> $contentTypeGroups | ||
*/ | ||
public function __construct( | ||
array $contentTypeGroups | ||
) { | ||
$this->contentTypeGroups = $contentTypeGroups; | ||
} | ||
|
||
/** | ||
* @return array<string, array<TContentTypeData>> | ||
*/ | ||
public function getContentTypeGroups(): array | ||
{ | ||
return $this->contentTypeGroups; | ||
} | ||
|
||
public function removeContentTypeGroup(string $contentTypeGroupIdentifier): void | ||
{ | ||
unset($this->contentTypeGroups[$contentTypeGroupIdentifier]); | ||
} | ||
} |
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