Adds a content item definition to the collection.

@param ContentItemDefinitionInterface $definition

@throws UnregisterableDefinitionException
967227
public function addContentItemDefinition(ContentItemDefinition $definition)
    {
        if (!is_string($definition->getMimeType())) {
            throw UnregisterableDefinitionException::notAStringMimeType($definition);
        }

        if (!in_array($definition->getMimeType(), ItemType::getList())) {
            throw UnregisterableDefinitionException::unsupportedMimeType($definition);
        }

        if ($this->has($definition->getMimeType())) {
            throw UnregisterableDefinitionException::duplicateMimeType($definition);
        }

        $this->definitions[$definition->getMimeType()] = $definition;
    }
1203840
public function addItem(ItemInterface $item)
    {
        $this->itemsChanged = true;
        $this->entity->addItem($item);

        return $this;
    }
1342167
public function setDefinition(array $definition) {
        $arguments = [];
        $options = [];
        foreach ($definition as $item) {
            if ($item instanceof Option) {
                $options[] = $item;
            }
            else {
                $arguments[] = $item;
            }
        }

        $this->setArguments($arguments);
        $this->setOptions($options);
    }
987184
public void registerContentDefinition(CmsContentDefinition definition) {

        m_widgetService.addConfigurations(definition.getConfigurations());
        CmsType baseType = definition.getTypes().get(definition.getEntityTypeName());
        m_entityBackend.registerTypes(baseType, definition.getTypes());
        m_entityBackend.registerEntity(definition.getEntity());
    }
400790
protected function addCollectionItem()
    {
        if (!$this->isError()) {
            $id = $this->collection_item->add($this->getSubmitted());
            if (empty($id)) {
                $this->errorAndExit($this->text('Unexpected result'));
            }
            $this->line($id);
        }
    }
710013
public function addItem($value)
    {
        if ($value instanceof LayoutItem) {
            $value = $value->jsonSerialize();
        } elseif (!is_array($value)) {
            throw new DomainException('Invalid layout item');
        }

        $items = $this->getAttribute('items') ?: [];
        $items[] = $value;

        return $this->setAttribute('items', $items);
    }
179999
public function loadDefinitionsFromService(BBcodeDefinitionCollectionInterface $collection)
    {
        foreach ($collection->getDefinitions() as $definition) {
            $this->addCodeDefinition($definition);
        }
    }
620038
public function addFilterItem($definetion, $name = null)
    {
        $this->getFilter()->addItem($definetion, $name);
        return $this;
    }
1093803
public function createDictionary(DictionaryDefinition $definition): DictionaryInterface
    {
        $builder = $this->getDictionaryBuilder($definition);

        /** @var DictionaryBuilderInterface $builder */
        return $builder->build($this, $definition);
    }
365719
public function setDefinition($definition)
	{
		if ($definition instanceof InputDefinition)
		{
			$this->definition = $definition;
		}
		else
		{
			$this->definition->setDefinition($definition);
		}

		$this->applicationDefinitionMerged = false;
	}
1305365
private function addTagsSubMenu(ItemInterface $menu)
    {
        $menuOrder = $this->getNewMenuOrder($menu);

        $menu
            ->addChild('eztags', ['route' => 'netgen_tags_admin_root'])
            ->setLabel('menu.main_menu.header')
            ->setExtra('translation_domain', 'eztags_admin');

        $menu->reorderChildren($menuOrder);
    }
1043226
public function setDefinition($definition) {
        if ($definition instanceof Definition) {
            $this->definition = $definition;
        }
        else {
            $this->definition->setDefinition($definition);
        }

        $this->consoleDefinitionMerged = false;

        return $this;
    }
533648
void setContentDefinition(CmsContentDefinition definition) {

        if (m_availableLocales.isEmpty()) {
            // only set the locales when initially setting the content definition
            m_availableLocales.putAll(definition.getAvailableLocales());
            m_contentLocales.addAll(definition.getContentLocales());
        } else {
            m_contentLocales.add(definition.getLocale());
        }
        m_title = definition.getTitle();
        m_sitePath = definition.getSitePath();
        m_resourceTypeName = definition.getResourceType();
        m_registeredEntities.add(definition.getEntityId());
        String tabs = "";
        for (CmsTabInfo info : definition.getTabInfos()) {
            tabs += info.getTabId() + ":" + info.getStartName() + "   ";
        }
        CmsDebugLog.consoleLog("Tabs: " + tabs);
        m_tabInfos = definition.getTabInfos();
        m_iconClasses = definition.getIconClasses();
        addContentDefinition(definition);
        CmsDefaultWidgetService service = (CmsDefaultWidgetService)getWidgetService();
        service.addConfigurations(definition.getConfigurations());
        service.setSyncValues(definition.getSyncValues());
        service.setSkipPaths(definition.getSkipPaths());
        addEntityChangeHandler(definition.getEntityId(), new ValueChangeHandler<CmsEntity>() {

            public void onValueChange(ValueChangeEvent<CmsEntity> event) {

                setChanged();
            }
        });
    }
759961
public function addDefinitions(array $definitions)
    {
        foreach ($definitions as $id => $definition) {
            $this->setDefinition($id, $definition);
        }
    }
615289
protected function resolveInterfaceExtension(InterfaceDefinition $definition, Endpoint $endpoint): void
    {
        $bundleNamespace = ClassUtils::relatedBundleNamespace($definition->getClass());
        $extensionClass = ClassUtils::applyNamingConvention($bundleNamespace, 'Extension', null, $definition->getName().'Extension');
        if (class_exists($extensionClass)) {
            foreach ($definition->getImplementors() as $implementor) {
                $definition->addExtension($extensionClass);
                $object = $endpoint->getType($implementor);
                if ($object instanceof HasExtensionsInterface) {
                    $object->addExtension($extensionClass);
                }
            }
        }
    }
215824
public function setDefinition($id, Definition $definition)
    {
        if ($this->isCompiled()) {
            throw new BadMethodCallException('Adding definition to a compiled container is not allowed');
        }

        $id = (string) $id;

        if ('' === $id || '\\' === $id[-1] || \strlen($id) !== strcspn($id, "\0\r\n'")) {
            throw new InvalidArgumentException(sprintf('Invalid service id: "%s"', $id));
        }

        unset($this->aliasDefinitions[$id], $this->removedIds[$id]);

        return $this->definitions[$id] = $definition;
    }
69846
public function addInclude(ItemInterface $item)
    {
        if ($this->hasInclude($item->getId()) === true) {
            throw new \RuntimeException(sprintf('A previous include item exists with the same id: "%s".', $item->getId()));
        }

        $this->includes[$item->getId()] = $item;
    }