Returns an id generator.

@param string $name The name.

@return \Mongator\Id\BaseIdGenerator The id generator.

@throws \InvalidArgumentException If the id generator does not exists.
483904
public static function get($name)
    {
        if (!isset(static::$idGenerators[$name])) {
            if (!static::has($name)) {
                throw new \InvalidArgumentException(sprintf('The id generator "%s" does not exists.', $name));
            }

            static::$idGenerators[$name] = new static::$map[$name];
        }

        return static::$idGenerators[$name];
    }
1371626
public function getSource($name)
    {
        if (!isset($this->sources[$name])) {
            throw new \InvalidArgumentException(sprintf('Source "%s" is not registered.', $name));
        }

        return $this->sources[$name];
    }
359620
public static function add($name, $class)
    {
        if (static::has($name)) {
            throw new \InvalidArgumentException(sprintf('The id generator "%s" already exists.', $name));
        }

        $r = new \ReflectionClass($class);
        if (!$r->isSubclassOf('Mongator\Id\BaseIdGenerator')) {
            throw new \InvalidArgumentException(sprintf('The class "%s" is not a subclass of Mongator\Id\BaseIdGenerator.', $class));
        }

        static::$map[$name] = $class;
    }
598126
public function getCollector($name)
    {
        if (!isset($this->collectors[$name])) {
            throw new \InvalidArgumentException(sprintf('Collector "%s" does not exist.', $name));
        }

        return $this->collectors[$name];
    }
432423
public function getProcessor($name)
    {
        if (!isset($this->processors[$name])) {
            throw new \InvalidArgumentException(sprintf('Processor "%s" is not registered.', $name));
        }

        return $this->processors[$name];
    }
1080069
public function getGenerator($name)
    {
        if ($this->hasGenerator($name) === false) {
            throw new \RuntimeException(sprintf('Generator not found: "%s".', $name));
        }

        return $this->generators[$name];
    }
635612
public function getType($name)
    {
        if (false === $this->hasType($name)) {
            throw new InvalidArgumentException(sprintf('The type "%s" was not found.', $name));
        }
        if (isset($this->loaded[$name])) {
            return $this->loaded[$name];
        }
        $fqcn = $this->types[$name];
        $type = new $fqcn;

        if (!$type instanceof TypeInterface) {
            throw new InvalidArgumentException(sprintf('The class "%s" must implement the "%s\\Types\TypeInterface"', $fqcn, __NAMESPACE__));
        }

        return $this->loaded[$name] = new $fqcn;
    }
680374
public function get($name)
    {
        if (!isset($this->assets[$name])) {
            throw new \InvalidArgumentException(sprintf('There is no "%s" asset.', $name));
        }

        return $this->assets[$name];
    }
1297989
public function getDictionary(string $name): Definition
    {
        if (!$this->hasDictionary($name)) {
            throw new \InvalidArgumentException('Dictionary not found: ' . $name);
        }

        return $this->dictionaries[$name];
    }
1082411
public function getPlugin($name)
    {
        if (!isset($this->plugins[$name])) {
            throw new \InvalidArgumentException(sprintf('Plugin %s is not registered'));
        }

        return $this->plugins[$name];
    }
974556
public function getBranding($name)
    {
        foreach ($this->brandings as $branding) {
            if ($branding->getName() === $name) {
                return $branding;
            }
        }

        $names = array_map(function ($branding) {
            return $branding->getName();
        }, $this->brandings);

        throw new \InvalidArgumentException(sprintf('No branding named "%s". Available are: %s.', $name, implode(', ', $names)));
    }
674472
public function getParameter($name)
    {
        $config = $this->get('config');
        if (!isset($config['parameters'][$name])) {
            throw new \InvalidArgumentException(sprintf('You have requested a non-existent parameter "%s".', $name));
        }

        return $config['parameters'][$name];
    }
208234
public static function createFromName($name)
    {
        $value = array_search($name, static::$names, true);

        if (!$value) {
            throw new InvalidArgumentException(sprintf(
                'Level with name "%s" is not in list: %s',
                $name,
                implode(', ', static::$names)
            ));
        }

        return new static($value);
    }
598446
public function getGenerator($name): GeneratorInterface
    {
        if (isset($this->generators[$name])) {
            return $this->generators[$name];
        }

        throw new Exception(sprintf('Generator %s does not exist.', $name));
    }
325658
protected function load($name)
    {
        $template = $this->parser->parse($name);

        $key = $template->getLogicalName();
        if (isset($this->cache[$key])) {
            return $this->cache[$key];
        }

        $storage = $this->loader->load($template);

        if (false === $storage) {
            throw new \InvalidArgumentException(sprintf('The template "%s" does not exist.', $template));
        }

        return $this->cache[$key] = $storage;
    }
70499
public function getChild( $name )
	{
		if( !array_key_exists( $name, $this->children ) )
			throw new InvalidArgumentException( 'A Child with Name "'.$name.'" is not existing.' );
		return $this->children[$name];
	}
784587
private function getFactoryObject($name)
    {
        if (!isset($this->adapters[$name])) {
            throw new \InvalidArgumentException(sprintf('No Adapter with name "%s" is registered.', $name));
        }

        if (!is_object($this->adapters[$name]['factory'])) {
            $factory = $this->adapters[$name]['factory'];

            $this->adapters[$name]['factory'] = new $factory();
        }

        return $this->adapters[$name]['factory'];
    }