src/Checkout/CheckoutComponentConfig.php
protected function dependantData($component, $data)
    {
        if (!$this->namespaced) { //no need to try and get un-namespaced dependant data
            return $data;
        }
        $dependantdata = array();
        foreach ($component->dependsOn() as $dependanttype) {
            $dependant = null;
            foreach ($this->components as $check) {
                if (get_class($check->Proxy()) == $dependanttype) {
                    $dependant = $check;
                    break;
                }
            }
            if (!$dependant) {
                user_error("Could not find a $dependanttype component, as depended by " . $component->name());
            }
            $dependantdata = array_merge(
                $dependantdata,
                $component->namespaceData($dependant->unnamespaceData($data))
            );
        }
        return array_merge($dependantdata, $data);
    }
protected function dependantData($component, $data)
    {
        if (!$this->namespaced) { //no need to try and get un-namespaced dependant data
            return $data;
        }
        $dependantdata = array();
        foreach ($component->dependsOn() as $dependanttype) {
            $dependant = null;
            foreach ($this->components as $check) {
                if (get_class($check->Proxy()) == $dependanttype) {
                    $dependant = $check;
                    break;
                }
            }
            if (!$dependant) {
                user_error("Could not find a $dependanttype component, as depended by " . $component->name());
            }
            $dependantdata = array_merge(
                $dependantdata,
                $component->namespaceData($dependant->unnamespaceData($data))
            );
        }
        return array_merge($dependantdata, $data);
    }
Helper function for saving data from other components.