public function addDefinition(ItemDefinitionInterface $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;
    }
public function addDefinition(ItemDefinitionInterface $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;
    }
public function addDefinition ( ItemDefinitionInterface $ 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 ; }
Adds a item definition to the collection.

@param ItemDefinitionInterface $definition

@throws UnregisterableDefinitionException
Adds a item definition to the collection .