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

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

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

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

@throws \RuntimeException If the item has been registered previously with the same id
Adds an new item .