Get the attributes that have been changed since last sync.

@return array
18731
public function getDirty()
    {
        $dirty = [];

        foreach ($this->getAttributes() as $key => $value) {
            if (! $this->originalIsEquivalent($key, $value)) {
                $dirty[$key] = $value;
            }
        }

        return $dirty;
    }
1149452
public function getAttributes(): array
    {
        $attributes = [];
        if ($this->confirm && $this->publicKey) {
            $attributes['confirm'] = $this->confirm;
            $attributes['public_key'] = $this->publicKey;
        }
        return $attributes;
    }
84989
public function getOldRelations()
    {
        $oldRelations = [];
        foreach ($this->_relations as $relationName) {
            $oldRelations[$relationName] = $this->getOldRelation($relationName);
        }
        return $oldRelations;
    }
1102857
protected function getDeletedEventAttributes(): array
    {
        $old = [];

        foreach ($this->attributes as $attribute => $value) {
            if ($this->isAttributeAuditable($attribute)) {
                $old[$attribute] = $value;
            }
        }

        return [
            $old,
            [],
        ];
    }
1082829
private function getCacheAttributes ()
	{
		
		$attributes	= array ();

		foreach (array_keys (self::$attributes) as $name)
		{
			$attributes[$name]	= $this->iget ($name);
		}
		
		return $attributes;
		
	}
1282985
public function getChangesForEditedEntities()
    {
        $edited = [];
        foreach ($this->changes as $change) {
            if ($change instanceof EditedEntity) {
                $edited[] = $change;
            }
        }

        return $edited;
    }
518785
public function getDirty()
    {
        $dirty = parent::getDirty();

        // We need to remove the primary key from the dirty attributes since primary keys
        // never change and when updating it shouldn't be part of the attributes.
        if (isset($dirty[$this->primaryKey])) unset($dirty[$this->primaryKey]);

        return $dirty;
    }
598162
public function getOldAttribute()
    {
        $age = config('forum.preferences.old_thread_threshold');
        return (!$age || $this->updated_at->timestamp < (time() - strtotime($age, 0)));
    }
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;
    }
732256
protected function getRemovedKeys()
    {
        $removedKeys = [];

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

            if (!array_key_exists($key, $this->attributes)) {
                $removedKeys[] = $key;
                continue;
            }
        }

        return $removedKeys;
    }
833811
public function changedFieldNames()
    {
        $diffed = clone $this->fromRecord;
        $fields = array_keys($diffed->toMap());

        $changedFields = [];

        foreach ($fields as $field) {
            if (in_array($field, $this->ignoredFields)) {
                continue;
            }
            if ($this->fromRecord->$field != $this->toRecord->$field) {
                $changedFields[] = $field;
            }
        }

        return $changedFields;
    }
1027318
public function getModifiedFiles() {
		try {
			return $this->extractFromCommand ( 'git diff --name-status HEAD', function ($array) {
				$array = trim ( preg_replace ( '!\s+!', ' ', $array ) );
				return explode ( ' ', $array );
			} );
		} catch ( \Cz\Git\GitException $e ) {
			return [ ];
		}
	}
830204
public function getDiff()
    {
        $diff = [];

        foreach ($this->getUpdated() as $key) {
            $diff[$key]['old'] = $this->old($key);

            $diff[$key]['new'] = $this->new($key);
        }

        return $diff;
    }
623933
public function getAttributes()
    {
        return [
            Attributes\IdAttribute::make(),
            Attributes\TextAttribute::make('name')
                ->setRequired(true)
                ->setUnique(true),
            Attributes\LongTextAttribute::make('description'),
            Attributes\TextAttribute::make('filename')
                ->setRequired(true),
            Attributes\EnumAttribute::make('filetype', array_keys(Config::get('amethyst.template.generators', [])))
                ->setRequired(true),
            Attributes\LongTextAttribute::make('content'),
            AmethystAttributes\FileChecksumAttribute::make('checksum'),
            Attributes\BelongsToAttribute::make('data_builder_id')
                ->setRelationName('data_builder')
                ->setRelationManager(DataBuilderManager::class),
            Attributes\CreatedAtAttribute::make(),
            Attributes\UpdatedAtAttribute::make(),
            Attributes\DeletedAtAttribute::make(),
        ];
    }
12527
public function changed($attrs=false) 
    {
        $changes = array();
        $cls     = get_called_class();

        foreach (self::$_columns[$cls] as $column) {
            // if is the primary key or one of the automatic columns, skip
            if ($cls::getPK() == $column || in_array(strtolower($column), array("created_at","updated_at"))) {
                continue;
            }

            $cur = $this->get($column);         // current value
            $old = $this->get($column, false);  // old value

            // if same value, didn't change
            if ($cur == $old) {
                continue;
            }

            // set the value as the changed column name
            $value = $column;

            // if checking the attributes, return an array with both values
            if ($attrs) {
                $value = array($old, $cur);
                $changes[$column] = $value;
            } else {
                array_push($changes, $value);
            }
        }
        return $changes;
    }
660820
public function calculateChangeSet()
    {
        if (false === $this->isDirty()) {
            return [];
        }
        return [
            'old' => empty($this->original) ? null : $this->original,
            'new' => empty($this->models) ? null : $this->models,
        ];
    }
894106
public function getAttributes(): array
    {
        $attributes = [];
        if ($this->blockIdFrom) {
            $attributes['from'] = $this->blockIdFrom;
        }
        if ($this->blockIdTo) {
            $attributes['to'] = $this->blockIdTo;
        }
        return $attributes;
    }