Replaces items in the collection with those given.

@param array|Arrayable $data
@return void
185141
public function replace($data) {

		if (! is_array($data)) {
			$data = $this->makeArray($data);
		}
		
		$this->_data = array_replace($this->_data, $data);
	}
363564
private function applyCachedData($data)
    {
        foreach ($data as $key => $value) {
            $this->$key = $value;
        }

        $this->cached = true;
    }
426437
public function load(array $data)
    {
        foreach ($data as $index => $value) {
            $this->set($index, $value);
        }
    }
426319
private function purgeOrphanedToCreateItems(array &$data)
    {
        foreach ($data['toCreate'] as $key => $timestamp) {
            $time = $this->time();

            if ($timestamp + self::DURATION_TWENTY_MINUTES < $this->time()) {
                unset($data['toCreate'][$key]);
            }
        }
    }
548375
public function __SET($name, $data){
		if (is_array($data)) {
			foreach ($data as $name => $value) {
				$this->_data[$name] = $this->clearData($value);
			}
		} else {
			$this->_data[$name] = $this->clearData($data);
		}
	}
911039
public function setData($data = [])
    {
        if (!is_array($data) && is_string($data)) {
            $data = parse_str($data);
        }
        if (count($data) == 0) {
            $this->data = [];
        } else {
            $this->data = $data;
        }
        $this->debug->debug(__FUNCTION__, 'Data into Request: ', $this->data);
    }
853177
public function setData($data = array())
    {
        

    	//empty local data
    	$this->rows = array();
    	//fill the local data
		foreach($data as $rowId => $cells){
			if(is_array($cells)){
				$this->addRow($rowId, $cells);
			}else if(is_string($cells)){
				$this->addRow($cells);
			}
		}

        
    }
310345
public function update(array $data)
    {
        $this->attributes = new Collection(array_merge($this->attributes->toArray(), $data));

        return $this->save();
    }
818696
protected function postUnserialize(array $data)
    {
        $this->repoPath = array_pop($data);
        $this->path = array_pop($data);
    }
30489
public function unserialize($data)
    {
        foreach (unserialize($data) as $item) {
            $this->insert($item['data'], $item['priority']);
        }
    }
907000
public function bind(array $data)
    {
        foreach ($data as $property => $value) {
            if ($this->has($property)) {
                $this->$property = $value;
            }
        }
    }
444742
public function addItems($data)
	{
		if( is_null($data) )
		{
			return;
		}

		if( $data instanceof stdClass )
		{
			$data = [$data];
		}

		if( is_array($data) )
		{
			$data = $this->checkItems($data);
			$this->data = array_merge($this->data, $data);
		}
	}
1209672
public function mergeData(array $data)
    {
        foreach ($data as $name => $val) {
            if (isset($this->_schema[$name])) {
                $this->$name = $val;
                $this->convertProperty($name);
            }
        }
    }
387387
public function set(array $data)
    {
        foreach ($data as $name => $value) {
            $this->setField($name, $value);
        }
    }
773594
protected function loadData(array $data = [])
    {
        foreach ($data as $key => $value) {
            if (property_exists($this, $key)) {
                $this->$key = $value;
            }
        }
    }
95938
protected function write(array $data)
    {
        $changes = $this->getChanges($data);

        $this->syncUpdated($changes['updated']);
        $this->syncInserted($changes['inserted']);
        $this->syncDeleted($changes['deleted']);
    }
312093
public function run(array $data)
    {
        foreach ($this->filters as $path) {
            foreach ($data as &$item) {
                $item = $this->filterItem($item, $path);
            }
        }

        return $data;
    }