/**
* Adds new configurator to collection
*
* @param LayoutBoxConfiguratorInterface $configurator
*
* @throws \InvalidArgumentException If such configurator already exists in collection
*/
public function add(LayoutBoxConfiguratorInterface $configurator)
{
$type = $configurator->getType();
if ($this->has($type)) {
throw new \InvalidArgumentException(sprintf('Layout box configurator "%s" already exists.', $type));
}
$this->items[$configurator->getType()] = $configurator;
}