toArray(); foreach ($data as $key => $child) { $data[$key] = $dehydrateChild($key, $child); } return [$data, ['class' => get_class($target)]]; } function hydrate($data, $meta, $hydrateChild) { $form = new $meta['class']($this->context->component, $this->path); static::bootFormObject($this->context->component, $form, $this->path); foreach ($data as $key => $child) { if ($child === null && Utils::propertyIsTypedAndUninitialized($form, $key)) { continue; } $form->$key = $hydrateChild($key, $child); } return $form; } function set(&$target, $key, $value) { if ($value === null && Utils::propertyIsTyped($target, $key)) { unset($target->$key); } else { $target->$key = $value; } } public static function bootFormObject($component, $form, $path) { $component->mergeOutsideAttributes( AttributeCollection::fromComponent($component, $form, $path . '.') ); } }