Add json attributes to the list of things that have changed (when
they've changed).

@return array
321708
public function getDirty($includeJson = false)
    {
        $dirty = parent::getDirty();

        if (!$includeJson) {
            return $dirty;
        }

        foreach (array_unique($this->jsonAttributes) as $attribute) {
            $originals[$attribute] = json_decode(array_get($this->original, $attribute, 'null'), true);
        }

        foreach ($this->jsonAttributes as $jsonAttribute => $jsonColumn) {
            if ($this->$jsonAttribute !== null &&
                $this->$jsonAttribute !== array_get($originals[$jsonColumn], $jsonAttribute)) {
                $dirty[$jsonAttribute] = json_encode($this->$jsonAttribute);
            }
        }

        return $dirty;
    }
525268
public function actionUpdate()
    {
        $data = [
            'f1' => $this->getContext()->getInput()->post('p1'),
            'f2' => $this->getContext()->getInput()->post('p2'),
            'id' => $this->getContext()->getInput()->get('id')
        ];

        $this->outputJson($data);
    }
758315
protected function prepareAttributes()
    {

        // initialize the values that has to be updated
        $updatedAt = date('Y-m-d H:i:s');
        $path = $this->getValue(ColumnKeys::PATH);

        // prepare and return the array with the updated values
        return array(
            MemberNames::PATH           => $path,
            MemberNames::UPDATED_AT     => $updatedAt
        );
    }
233430
function jsonSerialize()
    {
        $result = [
            'title'        => $this->getTitle(),
            'link'         => $this->getLink(),
            'publicId'     => $this->getPublicId(),
            'description'  => $this->getDescription(),
            'lastModified' => $this->getLastModified()->format(\DateTime::ATOM),
            'url'          => $this->getUrl(),
            'items'        => $this->getItems(),
            'relations'    => $this->getRelations(),
        ];
        return $result;
    }
1067928
public function getChangedFields() {
        if($this->isAfterSave() && method_exists($this->getEntity(), 'getUpdatedFields')) {
            if($this->getEntity()->hasSnapshotData()) {
                $actualChangedFields = $this->getEntity()->getUpdatedFields();
            } else {
                $actualChangedFields = $this->getSnapshotData();
            }
        } else { //Legacy
            $actualChangedFields = $this->getEntity()->getChangedFields();
        }
        $model = $this->getEntity();
        foreach($actualChangedFields as $index => $changedField) {
            $newValue = $model->readAttribute($changedField);
            if(is_array($newValue)) {
                $newValue = json_encode($newValue);
            }
            $oldValue = $this->getSnapshotData()[$changedField] ?? null ?? null;
            if(is_object($oldValue)) {
                $oldValue = (string)$oldValue;
            }
            if(is_object($newValue)) {
                $newValue = (string)$newValue;
            }
            if(is_bool($oldValue) || is_bool($newValue)){
                $oldValue = (bool) $oldValue;
                $newValue = (bool) $newValue;
            }
            if($oldValue === $newValue) {
                unset($actualChangedFields[$index]);
            }

        }
        return array_values($actualChangedFields);
    }
610213
public function jsonSerialize()
    {
        return array(
            self::ID    => $this->getOriginalName(),
            self::LABEL => $this->getOriginalName(),
            self::NAME  => $this->getOriginalName(),
        );
    }
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;
    }
349436
protected function changedRevisionableFields()
    {
        $changes = [];
        foreach ($this->dirtyData as $key => $value) {
            // check that the field is revisionable, and the data is dirty enough
            if ($this->isRevisionable($key) && !is_array($value)) {
                if (is_object($original = array_get($this->originalData, $key)) || is_string($original)) {
                    $original = trim($original);
                }

                if (is_object($updated = array_get($this->updatedData, $key)) || is_string($updated)) {
                    $updated = trim($updated);
                }

                if ($original != $updated) {
                    $changes[$key] = $value;
                }
            } else {
                // if it's not dirty enough, then remove the field from the array
                unset($this->updatedData[$key]);
                unset($this->originalData[$key]);
            }
        }

        return $changes;
    }
755736
private function replaceAttributesWithChange()
    {
        if (($change = static::lookupRequestedChange())
            && $change->key == $this->getKey()) {
            $this->attributes = array_merge(
                $this->attributes,
                $this->attributesAtChange($change)
            );
        }
    }
1304550
protected function getEmbeddedData()
    {
        if ($old = old($this->column)) {
            return $old;
        }

        if (empty($this->value)) {
            return [];
        }

        if (is_string($this->value)) {
            return json_decode($this->value, true);
        }

        return (array) $this->value;
    }
1157251
function changes($attr_name = null)
    {
        if (isset($attr_name)){
            return $this->_changes[$attr_name];
        }
        return $this->_changes;
    }
280506
public function getJsonableAttributes()
    {
        if ($this->jsonableAttributes !== null) {
            return $this->jsonableAttributes;
        }

        $this->jsonableAttributes = [];

        foreach (Cheat::get($this->model, 'casts') as $key => $cast) {
            if (in_array($cast, ['array', 'json', 'object', 'collection'], true)) {
                $this->jsonableAttributes[] = $key;
            }
        }

        return $this->jsonableAttributes;
    }
224906
protected function changes() {
		$changes = array();
		foreach ($this->cell as $name => $cell) {
			if ($cell->isDirty()) {
				$changes[$name] = $cell->get();
			}
		}
		return $changes;
	}
1081859
def changes
      _changes = {}
      changed.each do |attr|
        change = attribute_change(attr)
        _changes[attr] = change if change
      end
      _changes.with_indifferent_access
    end
796887
public function getAttributes(): array
    {
        $attributes = [];
        if (null !== $this->from) {
            $attributes['from'] = $this->from->getTimestamp();
        }
        return $attributes;
    }
740792
private function parseUpdates()
    {
        $updates = [];

        while (true) {
            $property = [
                'selector' => null,
                'name'     => null,
                'value'    => null,
            ];

            // parse left side
            $selectorName = $this->scanner->fetchNextToken();
            $delimiter = $this->scanner->fetchNextToken();

            if ($delimiter !== '.') {
                $property['selector'] = null;
                $property['name'] = $selectorName;
                $next = $delimiter;
            } else {
                $property['selector'] = $selectorName;
                $property['name'] = $this->scanner->fetchNextToken();
                $next = $this->scanner->fetchNextToken();
            }

            // parse right side
            $property['value'] = $this->parseOperand();

            $updates[] = $property;

            $next = $this->scanner->lookupNextToken();

            if ($next == ',') {
                $next = $this->scanner->fetchNextToken();
            } elseif (strtolower($next) == 'where' || !$next) {
                break;
            }
        }

        return $updates;
    }
555117
public function getDataAttributes()
    {
        $attributes = [
            'data-toggle' => 'popover',
            'data-container' => 'body',
            'data-placement' => $this->getPlacement()
        ];
        
        if (($parent = $this->getParent()) && $parent->ShowTitles) {
            $attributes['data-title'] = $this->Title;
        }
        
        $this->extend('updateDataAttributes', $attributes);
        
        return $attributes;
    }