Over write key value pairs in this collection with all of the data from an array or collection.

@param array|\Traversable $data Values to override over this config

@return self
769308
public function overwriteWith($data)
    {
        if (is_array($data)) {
            $this->data = $data + $this->data;
        } elseif ($data instanceof Collection) {
            $this->data = $data->toArray() + $this->data;
        } else {
            foreach ($data as $key => $value) {
                $this->data[$key] = $value;
            }
        }

        return $this;
    }
1110102
public function set(array $data)
    {
        foreach ($data as $field => $value) {
            $this->fields[] = $field;
            $this->dataParameters[":{$field}"] = $value;
        }
        return $this;
    }
505007
public function writeMany($data)
    {
        $cacheData = [];
        foreach ($data as $key => $value) {
            $cacheData[$this->_key($key)] = $value;
        }

        $success = $this->_Memcached->setMulti($cacheData);

        $return = [];
        foreach (array_keys($data) as $key) {
            $return[$key] = $success;
        }

        return $return;
    }
837646
public function fromArray($data)
    {
        foreach ($data as $key => $value) {
            if (is_int($key) || $this->isFillable($key)) {
                $this->set($key, $value);
            }
        }
        return $this;
    }
1193824
public function import($data) {
		
		if (! is_array($data)) {
			$data = is_callable(array($data, 'toArray')) ? $data->toArray() : (array)$data;
		}
		
		foreach($data as $key => $value) {
			$this[$key] = $value;
		}
		
		return $this;
	}
1226576
public function setDataFromArray(array $data)
    {
        foreach ($data as $property => $value) {
            $method = 'set' . ucfirst($property);
            if (method_exists($this, $method)) {
                $this->{$method}($value);
            } else {
                throw new \Parable\Routing\Exception(
                    "Tried to set non-existing property '{$property}' with value '{$value}' on " . get_class($this)
                );
            }
        }

        $this->checkValidProperties();
        $this->parseUrlParameters();

        return $this;
    }
423780
public function setData(array $data)
    {
        foreach ($data as $prop => $val) {
            $func = [$this, $this->setter($prop)];
            if (is_callable($func)) {
                call_user_func($func, $val);
            } else {
                $this->{$prop} = $val;
            }
        }

        return $this;
    }
669576
public function setRawData(array $data) {

        $this->rawData = $data;

        if (isset($data['message'])) {
            $this->setMessage($data['message']);
        }

        return $this;

    }
764235
public function setData($data)
    {
        $this->data = $data instanceof Structure ? $data : new Structure($data);

        return $this;
    }
595723
public function fromArray($data)
    {
        foreach ($data as $param => $value) {
            if (!method_exists($this, 'set' . ucfirst($param))) {
                continue;
            }
            $this->{'set' . ucfirst($param)}($value);
        }
        return $this;
    }
1142231
public static function createFromKeyData(array $data): self
    {
        if (!isset($data['keys'])) {
            throw new InvalidArgumentException('Invalid data.');
        }
        if (!\is_array($data['keys'])) {
            throw new InvalidArgumentException('Invalid data.');
        }
        $jwkset = new self([]);
        foreach ($data['keys'] as $key) {
            $jwk = new JWK($key);
            if ($jwk->has('kid')) {
                $jwkset->keys[$jwk->get('kid')] = $jwk;
            } else {
                $jwkset->keys[] = $jwk;
            }
        }

        return $jwkset;
    }
1165428
public function set_data($data) {
        $purpose = $this->get_persistent();

        $count = 0;
        foreach ($this->existingoverrides as $override) {
            $overridedata = $this->convert_existing_data_to_values($override->to_record());
            foreach ($overridedata as $key => $value) {
                $keyname = "roleoverride_{$key}[{$count}]";
                $data->$keyname = $value;
            }
            $count++;
        }

        parent::set_data($data);
    }
111809
public function setData($data)
    {
        foreach ($data as $field => $value) {
            $this->set($field, $value);
        }
        return $this;
    }
344542
public function setData($data)
    {
        foreach ($data as $key => $dtoData) {
            $this->data[$key] = new RuneDto($dtoData);
        }
    
        return $this;
    }
41646
public function fill($data): self {
        if (!is_array($data) && !is_object($data) && $data instanceof \Traversable) {
            throw new \InvalidArgumentException("fill data error");
        }

        // 兼容struct与collection
        foreach ($this instanceof coreInterfaces\Struct ? static::defaults() : $data
            as $key => $value) {

            if (isset($this->_excludeKeys[$key])) {
                continue;
            }
            isset($data[$key]) && $this->set($key, $data[$key]);
        }
        return $this;
    }
993796
public function push($data = [])
    {
        $name = $this->_through;
        $this->_parent->{$name}->push($offset, $this->_item($data));
        return $this;
    }
791200
public function setValues(array $data)
    {
        foreach($data as $key => $value) {
           $this->set($key, $value);
        }

        return $this;
    }