/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/ObjectMapper/Tests/Fixtures/NestedMappingWithClassTransformer/ParentTarget.php
36 строк
1 KB
Ryan RAJKOMAR
[ObjectMapper] Allow class FQDN arrays as TargetClass and SourceClass param
06 мар 2026, 18:16
06 мар 2026, 18:16
bf07ee6
Код
Авторство
О чём код?
<?php namespace Symfony\Component\ObjectMapper\Tests\Fixtures\NestedMappingWithClassTransformer; class ParentTarget { public string $name; public ChildWithClassTransformTarget $childWithClassTransformer; public ChildWithoutClassTransformerTarget $childWithoutClassTransformer; public ChildWithClassTransformTarget $childWithBothTransformers; public bool $transformed = false; public static function createFromSource(self $value, ParentSource $source): self { $value->transformed = true; return $value; } public static function childPropertyTransformer(ChildWithoutClassTransformerSource $value, ParentSource $source): ChildWithoutClassTransformerTarget { $target = new ChildWithoutClassTransformerTarget(); $target->name = 'child'; $target->propertyTransformed = true; return $target; } public static function childBothTransformer(ChildWithClassTransformSource $value, ParentSource $source): ChildWithClassTransformSource { $value->name = 'both'; return $value; } }