TenantAtlas/app/Support/References/ReferenceDescriptor.php
2026-03-10 19:51:41 +01:00

30 lines
789 B
PHP

<?php
declare(strict_types=1);
namespace App\Support\References;
final readonly class ReferenceDescriptor
{
/**
* @param array<string, mixed> $context
*/
public function __construct(
public ReferenceClass $referenceClass,
public string $rawIdentifier,
public ?int $workspaceId = null,
public ?int $tenantId = null,
public ?string $sourceType = null,
public ?string $sourceSurface = null,
public ?string $fallbackLabel = null,
public ?int $linkedModelId = null,
public ?string $linkedModelType = null,
public array $context = [],
) {}
public function contextValue(string $key, mixed $default = null): mixed
{
return data_get($this->context, $key, $default);
}
}