public function addItem(ItemInterface $item)
    {
        if ($this->hasItem($item->getId()) === true) {
            throw new \RuntimeException(sprintf('A previous item exists with the same id: "%s".', $item->getId()));
        }

        $this->items[$item->getId()] = $item;
    }
public function addItem(ItemInterface $item)
    {
        if ($this->hasItem($item->getId()) === true) {
            throw new \RuntimeException(sprintf('A previous item exists with the same id: "%s".', $item->getId()));
        }

        $this->items[$item->getId()] = $item;
    }
public function addItem ( ItemInterface $ item ) { if ( $ this -> hasItem ( $ item -> getId ( ) ) === true ) { throw new \ RuntimeException ( sprintf ( 'A previous item exists with the same id: "%s".' , $ item -> getId ( ) ) ) ; } $ this -> items [ $ item -> getId ( ) ] = $ item ; }
Adds a new item.

@param Yosymfony\Spress\Core\DataSource\ItemInterface $item

@throws RuntimeException If a previous item exists with the same id
Adds a new item .