denormalizer->denormalize($value, 'DigiComp\\HetznerDnsApi\\Model\\RecordResponse', 'json', $context); } $object->setRecords($values); } elseif (\array_key_exists('records', $data) && $data['records'] === null) { $object->setRecords(null); } if (\array_key_exists('valid_records', $data) && $data['valid_records'] !== null) { $values_1 = array(); foreach ($data['valid_records'] as $value_1) { $values_1[] = $this->denormalizer->denormalize($value_1, 'DigiComp\\HetznerDnsApi\\Model\\BaseRecord', 'json', $context); } $object->setValidRecords($values_1); } elseif (\array_key_exists('valid_records', $data) && $data['valid_records'] === null) { $object->setValidRecords(null); } if (\array_key_exists('invalid_records', $data) && $data['invalid_records'] !== null) { $values_2 = array(); foreach ($data['invalid_records'] as $value_2) { $values_2[] = $this->denormalizer->denormalize($value_2, 'DigiComp\\HetznerDnsApi\\Model\\BaseRecord', 'json', $context); } $object->setInvalidRecords($values_2); } elseif (\array_key_exists('invalid_records', $data) && $data['invalid_records'] === null) { $object->setInvalidRecords(null); } return $object; } /** * @return array|string|int|float|bool|\ArrayObject|null */ public function normalize($object, $format = null, array $context = array()) { $data = array(); if (null !== $object->getRecords()) { $values = array(); foreach ($object->getRecords() as $value) { $values[] = $this->normalizer->normalize($value, 'json', $context); } $data['records'] = $values; } if (null !== $object->getValidRecords()) { $values_1 = array(); foreach ($object->getValidRecords() as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); } $data['valid_records'] = $values_1; } if (null !== $object->getInvalidRecords()) { $values_2 = array(); foreach ($object->getInvalidRecords() as $value_2) { $values_2[] = $this->normalizer->normalize($value_2, 'json', $context); } $data['invalid_records'] = $values_2; } return $data; } }