Get the old/new attributes of an updated event.

@return array
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,
        ];
    }
960551
public function getAttributes(): array
    {
        $attributes = [];
        foreach ($this->attributes as $attributeName => $attribute) {
            $value = $attribute->value;
            $attributes[$attributeName] = $value !== '' ? (strstr($value, 'html5-dom-document-internal-entity') !== false ? $this->updateResult($value) : $value) : '';
        }
        return $attributes;
    }
576382
protected function get_legacy_eventdata() {
        $course = $this->get_record_snapshot('course', $this->objectid);
        $course->context = $this->context;
        $course->timemodified = $this->data['timecreated'];
        return $course;
    }
8936
public function getUpdatedAt()
    {
        $updatedAtAttribute = $this->updatedAtAttribute;
        if (!is_string($updatedAtAttribute) || empty($updatedAtAttribute)) {
            return null;
        }
        return $this->$updatedAtAttribute;
    }
965892
public function getCurrentPageAttributes()
    {
        // Create Attributes Array:
        
        $attributes = [];
        
        // Define Attributes Array:
        
        if ($id = $this->getCurrentPageClassID()) {
            $attributes['id'] = $id;
        }
        
        if ($class = $this->getCurrentPageAncestry()) {
            $attributes['class'] = $class;
        }
        
        // Extend Attributes Array:
        
        $this->extend('updateCurrentPageAttributes', $attributes);
        
        // Answer Attributes Array:
        
        return $attributes;
    }
121702
public function getAttributes()
    {
        // Quick, ugly hack to handle 5.6.37 update (getAttributes() now also called in performInsert()).
        if ($this->isPerformInsertInBacktrace()) {
            return parent::getAttributes();
        }

        return array_merge($this->attachedFiles, parent::getAttributes());
    }
728803
public function getOldAttributes()
    {
        $attributes = $this->prepareAttributes($this->original);
        $attributes = $this->getRevisionableItems($attributes);
        return $attributes;
    }
543718
public function getTooltipAttributes():array
    {
        if ($this->tooltip !== null) {
            $attrs = $this->tooltipOptions;
            $attrs['data-toggle'] = 'tooltip';
            $attrs['title'] = $this->tooltip;
            return $attrs;
        }
        return [];
    }
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 [];
    }
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;
    }
1052298
protected function get_legacy_eventdata() {
        $course = $this->get_record_snapshot('course', $this->objectid);
        $course->context = $this->context;
        $course->options = $this->other['options'];

        return $course;
    }
1332607
public function getAttributes()
    {
        return [
            Attributes\IdAttribute::make(),
            Attributes\TextAttribute::make('name')
                ->setRequired(true)
                ->setUnique(true),
            Attributes\LongTextAttribute::make('description'),
            Attributes\TextAttribute::make('event_class')
                ->setRequired(true),
            Attributes\BooleanAttribute::make('enabled'),
            Attributes\YamlAttribute::make('data')->setDefault(function (EntityContract $entity) {
                return file_get_contents(__DIR__.'/../../resources/schema/default/data.yaml');
            }),
            Attributes\TextAttribute::make('condition'),
            Attributes\BelongsToAttribute::make('work_id')
                ->setRelationName('work')
                ->setRelationManager(WorkManager::class)
                ->setRequired(true),
            Attributes\CreatedAtAttribute::make(),
            Attributes\UpdatedAtAttribute::make(),
            Attributes\DeletedAtAttribute::make(),
        ];
    }
593693
private function attributesAtChange(Change $change)
    {
        return $this->previousChanges($change)
            ->reduce(function($attributes, $change) {
                return array_merge($attributes, $change->changed);
            }, []);
    }
99165
public function getDirtyRawAttributes(): array
    {
        $attributes = $this->getRawAttributes();

        $cachedAttributes = $this->getCachedRawAttributes(array_keys($attributes));

        $dirty = [];

        foreach ($attributes as $key => $value) {
            if ($this->isActualRelation($key) || $key == 'pivot') {
                continue;
            }

            if (!array_key_exists($key, $cachedAttributes) && !$value instanceof Pivot) {
                $dirty[$key] = $value;
            } elseif ($value !== $cachedAttributes[$key] &&
                !$this->originalIsNumericallyEquivalent($value, $cachedAttributes[$key])) {
                $dirty[$key] = $value;
            }
        }

        return $dirty;
    }
275687
public function getAttributes($updated = false)
    {
        if (! $updated) return $this->attributes;

        $attributes = array();
        foreach ($this->attributes as $key => $value) {
            if (! array_key_exists($key, $this->o_attributes) || $value != $this->o_attributes[$key]) {
                $attributes[$key] = $value;
            }
        }
        return $attributes;
    }
1306780
public function getNewAttributes()
    {
        $attributes = $this->prepareAttributes($this->attributes);
        $attributes = $this->getRevisionableItems($attributes);
        return $attributes;
    }
660820
public function calculateChangeSet()
    {
        if (false === $this->isDirty()) {
            return [];
        }
        return [
            'old' => empty($this->original) ? null : $this->original,
            'new' => empty($this->models) ? null : $this->models,
        ];
    }