Добавил проверку на пустое значение

master v0.0.9
Sipachev Igor 3 years ago
parent 02f5719514
commit 5e470a4497
  1. 3
      src/Data2DtoConverter.php

@ -72,8 +72,7 @@ class Data2DtoConverter
{ {
$propertyExtractor = new PropertyExtractor($property->class, $property->getName()); $propertyExtractor = new PropertyExtractor($property->class, $property->getName());
if ($propertyExtractor->fetch(VirtualProperty::class)) { if ($propertyExtractor->fetch(VirtualProperty::class)) {
if ($property->isInitialized($object)) { if ($property->isInitialized($object) && $propertyValue = $property->getValue($object)) {
$propertyValue = $property->getValue($object);
$value = $this->convert($data, $propertyValue, $tags); $value = $this->convert($data, $propertyValue, $tags);
} else { } else {
$propertyType = $property->getType()->getName(); $propertyType = $property->getType()->getName();

Loading…
Cancel
Save