protected function isDirty(AbstractEntity $entity, $attr)
    {
        $attr = (string) $attr;

        if ($entity->_isDirty($attr)) {
            $cls = str_replace('\\', '_', get_class($entity));
            $uid = (string) $entity->getUid();
            $val = $entity->{'get' . ucwords($attr)}();

            if (!isset($this->dirty[$cls])) {
                $this->dirty[$cls] = [];
            }

            if (!isset($this->dirty[$cls][$uid])) {
                $this->dirty[$cls][$uid] = [];
            }

            if (!isset($this->dirty[$cls][$uid][$attr])) {
                $this->dirty[$cls][$uid][$attr] = null;
            }

            if ($this->dirty[$cls][$uid][$attr] !== $val) {
                $this->dirty[$cls][$uid][$attr] = $val;
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    }