diff --git a/src/Attribute/VirtualProperty.php b/src/Attribute/VirtualProperty.php new file mode 100644 index 0000000..54271a1 --- /dev/null +++ b/src/Attribute/VirtualProperty.php @@ -0,0 +1,12 @@ +getType(); $propertyType = $reflectionPropertyType->getName(); + // Для виртуальных полей добавляем пустой масиив, чтобы заполнить поля дто + $propertyExtractor = new PropertyExtractor($property->class, $property->getName()); + if ($propertyExtractor->fetch(VirtualProperty::class)) { + if (!array_key_exists($property->getName(), $data)) { + $data[$property->getName()] = []; + } + } + if ($dataPath = $this->grabDataPath($property, $data, $tags)) { $value = $data[$dataPath]; // Трансформируем данные