public function fields(EntityInterface $entity)
    {
        $fields = [];
        foreach ((array)$this->getConfig('fields') as $field) {
            if (!$entity->isDirty($field)) {
                continue;
            }
            $fields[$field] = $entity->$field;
            $entity->setDirty($field, false);
        }

        return $fields;
    }