Set original values for fields.

@param array $data

@return $this
18554
public function setOriginal($data)
    {
        if (empty($data)) {
            return $this;
        }

        if (is_string($data)) {
            $data = json_decode($data, true);
        }

        $this->original = $data;

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

        return $this;
    }
1166295
public function setAllData($data)
    {
        array_walk(
            $data,
            function ($value, $key) {
                $this->{$key} = $value;
            }
        );

        return $this;
    }
1321478
protected function setWithArrayData(array $data)
    {
        if (isset($data[0])) { // multiple rows
            foreach ($data as $row) {
                $this->set($row);
            }
        } else { // multiple values
            foreach ($data as $col => $val) {
                $this->set($col, $val);
            }
            $this->set_row++;
        }
        return $this;
    }
98412
public function setMany(array $data)
    {
        foreach($data as $key => $value) {
            $this->_data[$key] = $value;
        }

        return $this;
    }
77817
public function setData($data)
    {
        $this->originalData = $data;

        if ($data instanceof \Iterator) {
            $this->iterator = $data;
        }
        elseif (is_array($data)) {
            $this->iterator = new \ArrayIterator($data);
        }
        else {
            $this->iterator = new \ArrayIterator(array($data));
        }
    }
708099
public function setData(array $data)
    {
        if (count($data)) {
            $data = array_combine($data, $data);
        }

        $this->_data = $data;

        return $this;
    }
374566
public function setFieldValues(array $values)
    {
        foreach ($values as $name => $value) {
            $this->setFieldValue($name, $value);
        }
        return $this;
    }
152807
public function exchangeArray(array $data)
    {
        $attributes = array_keys($this->toArray());
        foreach ($attributes as $field) {
            if (isset($data[$field])) {
                $this->$field = $data[$field];
            }
        }
        return $this;
    }
921713
private function setData(array $data = null)
    {
        if (null === $data || count($data) === 0) {
            $data = new \stdClass();
        }

        $this->data = $data;

        return $this;
    }
1235518
public function fill(array $data)
    {
        foreach ($data as $column => $value) {
            $this->__set($column, $value);
        }
        return $this;
    }
16808
public function setOriginal($data)
    {
        if (is_array($this->column)) {
            foreach ($this->column as $key => $column) {
                $this->original[$key] = array_get($data, $column);
            }

            return;
        }

        $this->original = array_get($data, $this->column);
    }
931550
public function data(array $data, array $fields = [])
    {
        // Allows filtering of used input fields against optional second array of field names allowed
        // This is useful for limiting raw $_POST or $_GET data to only known fields
        $this->_fields = $fields !== [] ? \array_intersect_key($data, \array_flip($fields)) : $data;

        return $this;
    }
233030
public function set(array $data)
    {
        $this->data = [];
        $this->replace = false;

        foreach ($data as $key => $value) {
            $this->add($key, $value);
        }
    }
1276452
public function setMultiData(array $data = [])
    {
        if (empty($data)) {
            unset($this->query['multi-data']);
        } else {
            $this->query['multi-data'] = $data;
        }
        return $this;
    }
373230
public function mapData(array $data) {
        $this->flush();

        if (!empty($data[$this->primaryKey])) {
            $this->_exists = true;
        }

        $this->_original = Hash::exclude($data, $this->reserved);
        $this->_attributes = $data;

        return $this;
    }
1069423
private function setValues(array $data)
    {
        foreach ($data as $key => $datum) {
            $this->set($key, $datum);
        }
        return $this;
    }