public function getType($name)
    {
        if ($this->hasType($name)) {
            return $this->types[$name];
        } else {
            throw new \InvalidArgumentException(sprintf('Widget type "%s" not found.', $name));
        }
    }