public function copyFrom ($data) {
        if (is_array ($data) || ($data instanceof \Traversable)) {
            $this->clear ();
            foreach ($data as $item) {
                $this->_d[] = $item;
                ++$this->_c;
            }
        } elseif ($data !== null)
            throw new Exception(\Yii::t ('yii' , 'Queue data must be an array or an object implementing Traversable.'));
    }
public function copyFrom ($data) {
        if (is_array ($data) || ($data instanceof \Traversable)) {
            $this->clear ();
            foreach ($data as $item) {
                $this->_d[] = $item;
                ++$this->_c;
            }
        } elseif ($data !== null)
            throw new Exception(\Yii::t ('yii' , 'Queue data must be an array or an object implementing Traversable.'));
    }
public function copyFrom ( $ data ) { if ( is_array ( $ data ) || ( $ data instanceof \ Traversable ) ) { $ this -> clear ( ) ; foreach ( $ data as $ item ) { $ this -> _d [ ] = $ item ; ++ $ this -> _c ; } } elseif ( $ data !== null ) throw new Exception ( \ Yii :: t ( 'yii' , 'Queue data must be an array or an object implementing Traversable.' ) ) ; }
Copies iterable data into the queue.
Note, existing data in the list will be cleared first.
@param mixed $data the data to be copied from, must be an array or object implementing Traversable
@throws \yii\base\Exception If data is neither an array nor a Traversable.
Copies iterable data into the queue . Note existing data in the list will be cleared first .