public function set($items)
    {
        $this->emitOnChange(__METHOD__);
        $this->clear();
        foreach ($items as $item) {
            $this->add($item);
        }
        $this->endEmitOnChange(__METHOD__);
        return $this;
    }
public function set($items)
    {
        $this->emitOnChange(__METHOD__);
        $this->clear();
        foreach ($items as $item) {
            $this->add($item);
        }
        $this->endEmitOnChange(__METHOD__);
        return $this;
    }
public function set ( $ items ) { $ this -> emitOnChange ( __METHOD__ ) ; $ this -> clear ( ) ; foreach ( $ items as $ item ) { $ this -> add ( $ item ) ; } $ this -> endEmitOnChange ( __METHOD__ ) ; return $ this ; }
Removes old and sets new collection items.

@param array|Traversable $items

@return $this
Removes old and sets new collection items .