public function type($class)
    {
        // Remove leading backslash. All namespaces are assumed absolute in YAML
        $class = ltrim($class, '\\');

        foreach ($this->types as $scaffold) {
            if ($scaffold->getDataObjectClass() === $class) {
                return $scaffold;
            }
        }

        $scaffold = Injector::inst()->create(DataObjectScaffolder::class, $class)
                ->setChainableParent($this);
        $this->types[] = $scaffold;

        return $scaffold;
    }