Swaps changed (original) attributes with current attributes.

@return $this
199597
public function swapChangedAttributes()
    {
        if (false === $this->originalAttributesLoaded) {

            $this->swappedAttributes = $this->getAttributes();
            $this->fill($this->getOriginal());

            $this->originalAttributesLoaded = true;

            return $this;
        }

        if  ( ! count($this->swappedAttributes)) {
            $this->swappedAttributes = $this->getAttributes();
        }

        $this->fill($this->swappedAttributes);

        $this->originalAttributesLoaded = false;

        return $this;
    }
112706
public function reset()
    {
        $this->_data     = array();
        $this->_modified = array();

        if ($this->isConnected()) {
            $this->_data = $this->getTable()->getDefaults();
        }

        return $this;
    }
960589
function change($attr_name, $new_value)
    {
        if (!$this->is_changed($attr_name)){
            $this->_changes[$attr_name] = $this->_attributes[$attr_name];
        }else
        if ($this->_changes[$attr_name] === $new_value){
            unset($this->_attributes[$attr_name]);
        }
        $this->_attributes[$attr_name] = $new_value;
    }
929741
public function updateModels(iterable $attributes): self
    {
        $this->update($this->quoteSingleIdentifier($this->getTableName()));

        foreach ($this->bindAttributes($this->getModelClass(), $attributes) as $quotedColumn => $parameterName) {
            $this->set($quotedColumn, $parameterName);
        }

        return $this;
    }
1312342
public function withAttributes(array $attributes)
    {
        $this->attributes = $this->immutable + $attributes + $this->attributes;

        return $this;
    }
242922
protected function getModifiedData()
    {
        $modified = [];

        foreach ($this->attributes as $key=>$value) {

            // Every previously not existing key is modified
            if (!array_key_exists($key, $this->originalAttributes)) {
                $modified[$key] = $value;
                continue;
            }

            if ($this->valueWasModified($this->originalAttributes[$key], $this->attributes[$key])) {
                $modified[$key] = $value;
            }
        }

        return $modified;
    }
1128051
public function replaceMissingAttributes()
    {
        // collect persisted attributevalues
        $persistedAttributes = array();
        foreach ($this->getValueSet()->getValues() as $value) {
            $persistedAttributes[] = $value->getAttribute();
        }

        $newValues = array();
        // Create empty entities for missing attributes
        $missingAttributes = array_diff($this->getValueSet()->getAttributes()->toArray(), $persistedAttributes);
        foreach ($missingAttributes as $attribute) {
            $valueClass = $attribute->getValueType();
            $value = new $valueClass();

            $this->getValueSet()->addValue($value);
            $value->setValueSet($this->getValueSet());
            $value->setAttribute($attribute);

            $newValues[] = $value;
        }

        return $newValues;
    }
976797
public function flip(): self
    {
        $collection = Factory::create();
        foreach ($this->items as $key => $value) {
            $collection->set($value, $key);
        }

        return $collection;
    }
725867
public function revert_attribute( $attribute ) {
		if ( array_key_exists( $attribute, $this->attributes ) ) {
			$this->attributes[ $attribute ] = $this->original[ $attribute ];
		}

		return $this;
	}
600530
public function sync_original() {
		$this->original = $this->attributes;

		if ( $this->attributes[ self::OBJECT_KEY ] ) {
			$this->original[ self::OBJECT_KEY ] = clone $this->attributes[ self::OBJECT_KEY ];
		}

		foreach ( $this->original[ self::TABLE_KEY ] as $key => $item ) {
			if ( is_object( $item ) ) {
				$this->original[ $key ] = clone $item;
			}
		}

		return $this;
	}
593693
private function attributesAtChange(Change $change)
    {
        return $this->previousChanges($change)
            ->reduce(function($attributes, $change) {
                return array_merge($attributes, $change->changed);
            }, []);
    }
247514
public function push()
    {
        $args = func_get_args();

        if (!empty($args)) {
            foreach ($args as  $arg) {
                array_push($this->attributes, $arg);
            }
        }

        return $this;
    }
267596
public function changing($attribute, $value)
    {
        $this->setToken('Attribute', $attribute);
        $this->setToken('Value', $value);

        return $this;
    }
1228755
public function swap()
    {
        $first = $this->first;
        $this->first = $this->second;
        $this->second = $first;
        return $this;
    }
877034
public function clear()
  {
    $this->_object = $this->_changed = $this->_operations = $this->_dirty = $this->_related_objects = array();
    $this->_loaded = NULL;
    return $this;
  }
731500
public function getMutatedAttributes()
    {
        $attributes = parent::getMutatedAttributes();
        $jsonAttributes = array_keys($this->jsonAttributes);

        return array_merge($attributes, $jsonAttributes);
    }
739030
function() {
    for (var name in this.changes) {
      if (this.changes.hasOwnProperty(name)) {
        this.attributes[name] = this.changes[name][0]
      }
    }

    this.changes = {}
    return this
  }