public function registerAttributeChange($attrName, $newValue)
    {
        if (!$this->attributeChanged($attrName)) {
            $oldValue = $this->attributes->get($attrName);
            if ((string)$newValue != (string)$oldValue) {
                $this->changedAttributes[$attrName] = $oldValue;
            }
        } elseif ((string)$newValue == (string)$this->changedAttributes[$attrName]) {
            unset($this->changedAttributes[$attrName]);
        }
    }