Initial commit: CloudOps infrastructure platform

This commit is contained in:
root
2026-04-09 19:58:57 +02:00
commit 1166a52f26
7762 changed files with 839452 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
<?php
declare(strict_types=1);
namespace Mautic\ProjectBundle\Event;
use Symfony\Contracts\EventDispatcher\Event;
/**
* Event dispatched to allow bundles to extend entity type to model key mappings.
*/
final class EntityTypeModelMappingEvent extends Event
{
/**
* @param array<string, string> $mappings
*/
public function __construct(private array $mappings = [])
{
}
/**
* Add a model key mapping.
*/
public function addMapping(string $entityType, string $modelKey): void
{
$this->mappings[$entityType] = $modelKey;
}
/**
* Add multiple model key mappings.
*
* @param array<string, string> $mappings
*/
public function addMappings(array $mappings): void
{
$this->mappings = array_merge($this->mappings, $mappings);
}
/**
* Get all model key mappings.
*
* @return array<string, string>
*/
public function getMappings(): array
{
return $this->mappings;
}
/**
* Get model key for entity type or return entity type if no mapping exists.
*/
public function getModelKey(string $entityType): string
{
return $this->mappings[$entityType] ?? $entityType;
}
}

View File

@@ -0,0 +1,56 @@
<?php
declare(strict_types=1);
namespace Mautic\ProjectBundle\Event;
use Symfony\Contracts\EventDispatcher\Event;
/**
* Event dispatched to allow bundles to extend entity type normalization mappings.
*/
final class EntityTypeNormalizationEvent extends Event
{
/**
* @param array<string, string> $mappings
*/
public function __construct(private array $mappings = [])
{
}
/**
* Add a normalization mapping.
*/
public function addMapping(string $from, string $to): void
{
$this->mappings[$from] = $to;
}
/**
* Add multiple normalization mappings.
*
* @param array<string, string> $mappings
*/
public function addMappings(array $mappings): void
{
$this->mappings = array_merge($this->mappings, $mappings);
}
/**
* Get all normalization mappings.
*
* @return array<string, string>
*/
public function getMappings(): array
{
return $this->mappings;
}
/**
* Get normalized entity type or return original if no mapping exists.
*/
public function getNormalizedType(string $entityType): string
{
return $this->mappings[$entityType] ?? $entityType;
}
}