@override
Get the attributes that have been changed since last sync.

@return array
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;
    }
508455
protected function getUpdatedEventAttributes(): array
    {
        $old = [];
        $new = [];

        foreach ($this->getDirty() as $attribute => $value) {
            if ($this->isAttributeAuditable($attribute)) {
                $old[$attribute] = Arr::get($this->original, $attribute);
                $new[$attribute] = Arr::get($this->attributes, $attribute);
            }
        }

        return [
            $old,
            $new,
        ];
    }
633213
public function get_changed_table_attributes() {
		$changed = array();

		foreach ( $this->get_table_attributes() as $key => $value ) {
			if ( $value !==
				 $this->get_original_attribute( $key )
			) {
				$changed[ $key ] = $value;
			}
		}

		return $changed;
	}
1102857
protected function getDeletedEventAttributes(): array
    {
        $old = [];

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

        return [
            $old,
            [],
        ];
    }
593080
public function getUnchangedAttributes()
    {
        $output = array();

        foreach ($this->attributes as $name => $value) {
            if (!$this->hasChanged($name)) {
                $output[$name] = $value;
            }
        }

        return $output;
    }
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;
    }
1334205
public function getAttributes()
    {
        // prevent order of fields from changing
        $sortedAttribs = [];
        foreach ($this->sortedFields as $ix => $attribute) {
            $sortedAttribs[$attribute] = $this->attributes[$attribute];
        }

        return $sortedAttribs;
    }
851612
public function detectChanges()
    {
        clearstatcache(true, $this->path);

        if (! $this->exists && $this->files->exists($this->path)) {
            $this->lastModified = $this->files->lastModified($this->path);
            $this->exists = true;

            return [new Event($this, Event::RESOURCE_CREATED)];
        } elseif ($this->exists && ! $this->files->exists($this->path)) {
            $this->exists = false;

            return [new Event($this, Event::RESOURCE_DELETED)];
        } elseif ($this->exists && $this->isModified()) {
            $this->lastModified = $this->files->lastModified($this->path);

            return [new Event($this, Event::RESOURCE_MODIFIED)];
        }

        return [];
    }
589425
public function getOwnConstants()
    {
        if ($this->getParentClass() === false) {
            return $this->getConstants();
        } else {
            return array_diff_key($this->getConstants(), $this->getParentClass()->getConstants());
        }
    }
63784
public function getDirtyAttributes()
    {
        $values = array();
        foreach (array_keys(get_object_vars($this)) as $key) {
            if (in_array($key, $this->_dirtyAttr)) {
                $values[$key] = $this->$key;
            } elseif ($this->$key instanceof ArrayObject) {
                foreach ($this->$key as $sub) {
                    if (($sub instanceof DirtyAware) && $sub->isDirty()) {
                        if (!array_key_exists($key, $values)) {
                            $values[$key] = new $this->$key;
                        }
                        $values[$key]->append($sub);
                    }
                }
            }
        }
        return $values;
    }
602657
public function getModifiedProperties()
    {
        if ($this->read_only) {
            return array();
        }

        $modified_properties = array();
        foreach ($this->getProperties() as $name => $value) {
            $hashed_value = $this->getHashValue($value);
            if (
                array_key_exists($name, $this->property_hashes) &&
                $hashed_value !== $this->property_hashes[$name]
            ) {
                $modified_properties[$name] = $value;
            }
        }

        return $modified_properties;
    }
1055714
public function getDiffReplacements()
    {
        $data = array();
        foreach ($this->getSafeAttributes() as $attribute) {
            if ($attribute->isReplaced()) {
                $data[$attribute->getName()] = $attribute->getValues();
            }
        }
        foreach ($this->tracker->getReplacements() as $name) {
            $data[$name] = $this->get($name)->getValues();
        }
        return $data;
    }
1348970
public function get_dirty() {
		$dirty = [];

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

		return $dirty;
	}
547689
public function getVersionsToSync()
    {
        $versionsToSync      = [ ];
        $remote              = $this->client($this->setting('connection'));
        $currentVersions     = $this->project->getRefs();
        $allowedVersionRange = new expression($this->setting('sync.constraints.versions'));
        $tags                = $remote->getTags($this->setting('repository'), $this->setting('owner'));
        $skipPatch           = $this->setting('sync.constraints.skip_patch_versions', false);
        $skipMinor           = $this->setting('sync.constraints.skip_minor_versions', false);
        $skipPatch           = $skipMinor === true ? true : $skipPatch; // if we skip minors, we automaticly skip patches as well

        $this->fire('versions.start', [ $tags ]);

        foreach ( $tags as $tag => $sha )
        {
            try
            {
                $version = new version($tag);
            }
            catch (SemVerException $e)
            {
                continue;
            }

            // Check all version constraints
            if ( $version->satisfies($allowedVersionRange) === false || in_array($version->getVersion(), $currentVersions, true) )
            {
                continue;
            }
            if ( $skipPatch === true && $version->getPatch() !== 0 )
            {
                continue;
            }
            if ( $skipMinor === true && $version->getMinor() !== 0 )
            {
                continue;
            }

            // This version is inside constraints, add it
            $versionsToSync[] = $version;
        }

        $this->fire('versions.finish', [ $versionsToSync ]);
        return $versionsToSync;
    }
224906
protected function changes() {
		$changes = array();
		foreach ($this->cell as $name => $cell) {
			if ($cell->isDirty()) {
				$changes[$name] = $cell->get();
			}
		}
		return $changes;
	}
796887
public function getAttributes(): array
    {
        $attributes = [];
        if (null !== $this->from) {
            $attributes['from'] = $this->from->getTimestamp();
        }
        return $attributes;
    }
706286
public function getAttributes()
    {
        return [
            Attributes\IdAttribute::make(),
            Attributes\TextAttribute::make('name')
                ->setRequired(true)
                ->setUnique(true),
            Attributes\LongTextAttribute::make('description'),
            Attributes\BelongsToAttribute::make('data_builder_id')
                ->setRelationName('data_builder')
                ->setRelationManager(DataBuilderManager::class),
            Attributes\YamlAttribute::make('payload')->setDefault(function (EntityContract $entity) {
                return file_get_contents(__DIR__.'/../../resources/schema/default/payload.yaml');
            }),
            Attributes\YamlAttribute::make('data')->setDefault(function (EntityContract $entity) {
                return file_get_contents(__DIR__.'/../../resources/schema/default/data.yaml');
            }),
            Attributes\CreatedAtAttribute::make(),
            Attributes\UpdatedAtAttribute::make(),
            Attributes\DeletedAtAttribute::make(),
        ];
    }