/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/ObjectMapper/Tests/Fixtures/NestedMappingWithClassTransformer/ParentSource.php
26 строк
954 B
Thibaut Cholley
[ObjectMapper] fix nested mapping with class-level transform
24 фев 2026, 10:26
24 фев 2026, 10:26
bbe24a1
Код
Авторство
О чём код?
<?php namespace Symfony\Component\ObjectMapper\Tests\Fixtures\NestedMappingWithClassTransformer; use Symfony\Component\ObjectMapper\Attribute\Map; #[Map(target: ParentTarget::class, transform: [ParentTarget::class, 'createFromSource'])] class ParentSource { public string $name = 'parent'; public ChildWithClassTransformSource $childWithClassTransformer; #[Map(transform: [ParentTarget::class, 'childPropertyTransformer'])] public ChildWithoutClassTransformerSource $childWithoutClassTransformer; #[Map(transform: [ParentTarget::class, 'childBothTransformer'])] public ChildWithClassTransformSource $childWithBothTransformers; public function __construct() { $this->childWithClassTransformer = new ChildWithClassTransformSource(); $this->childWithoutClassTransformer = new ChildWithoutClassTransformerSource(); $this->childWithBothTransformers = new ChildWithClassTransformSource(); } }