public function addData($data)
    {
        if (empty($this->_data)) {
            $this->_data = $data;
        } else {
            if (!is_array($this->_data)) {
                throw new \yii\base\Exception('Unable to merge existing data with new data. Existing data is not an array.');
            }
            $this->_data = array_merge($this->_data, $data);
        }
        return $this;
    }
public function addData($data)
    {
        if (empty($this->_data)) {
            $this->_data = $data;
        } else {
            if (!is_array($this->_data)) {
                throw new \yii\base\Exception('Unable to merge existing data with new data. Existing data is not an array.');
            }
            $this->_data = array_merge($this->_data, $data);
        }
        return $this;
    }
public function addData ( $ data ) { if ( empty ( $ this -> _data ) ) { $ this -> _data = $ data ; } else { if ( ! is_array ( $ this -> _data ) ) { throw new \ yii \ base \ Exception ( 'Unable to merge existing data with new data. Existing data is not an array.' ) ; } $ this -> _data = array_merge ( $ this -> _data , $ data ) ; } return $ this ; }
Adds data fields to the existing ones.
@param array $data additional content data fields.
@return $this self reference.
@since 2.0.1
Adds data fields to the existing ones .