public function replace($id, ItemInterface $newItem)
    {
        $success = false;
        foreach ($this->items as $i => $item) {
            if ($item->getFeedId() == $id) {
                $this->items[$i] = $newItem;
                $success = true;
                break;
            }
        }

        if (false === $success) {
            throw new \InvalidArgumentException('Unknown item');
        }

        return $this;
    }
public function replace($id, ItemInterface $newItem)
    {
        $success = false;
        foreach ($this->items as $i => $item) {
            if ($item->getFeedId() == $id) {
                $this->items[$i] = $newItem;
                $success = true;
                break;
            }
        }

        if (false === $success) {
            throw new \InvalidArgumentException('Unknown item');
        }

        return $this;
    }
public function replace ( $ id , ItemInterface $ newItem ) { $ success = false ; foreach ( $ this -> items as $ i => $ item ) { if ( $ item -> getFeedId ( ) == $ id ) { $ this -> items [ $ i ] = $ newItem ; $ success = true ; break ; } } if ( false === $ success ) { throw new \ InvalidArgumentException ( 'Unknown item' ) ; } return $ this ; }
Replace an Item by an other

@throws \InvalidArgumentException
@param $id
@param ItemInterface $newItem
@return Feed
Replace an Item by an other