public function getAll(array $options = [])
    {
        // This preserves compatibility for the old includeInternals parameter.
        $includeInternals       = false;
        $ignoreHiddenAttributes = $this->{self::ENTRY_IGNOREHIDDENATTRIBUTES};
        $_hiddenAttributes      = $this->{self::ENTRY_HIDDENATTRIBUTES};

        if (!is_array($options)) {
            $includeInternals = $options;
        } else {
            // keeping the non-underscored version for backwards-compatibility
            $includeInternals = array_key_exists(
                'includeInternals',
                $options
            ) ? $options['includeInternals'] : $includeInternals;

            $includeInternals = array_key_exists(
                '_includeInternals',
                $options
            ) ? $options['_includeInternals'] : $includeInternals;

            // keeping the non-underscored version for backwards-compatibility
            $ignoreHiddenAttributes = array_key_exists(
                'ignoreHiddenAttributes',
                $options
            ) ? $options['ignoreHiddenAttributes'] : $ignoreHiddenAttributes;

            $ignoreHiddenAttributes = array_key_exists(
                self::ENTRY_IGNOREHIDDENATTRIBUTES,
                $options
            ) ? $options[self::ENTRY_IGNOREHIDDENATTRIBUTES] : $ignoreHiddenAttributes;

            $_hiddenAttributes = array_key_exists(
                self::ENTRY_HIDDENATTRIBUTES,
                $options
            ) ? $options[self::ENTRY_HIDDENATTRIBUTES] : $_hiddenAttributes;
        }

        $data         = $this->_values;
        $nonInternals = ['_changed', '_values', self::ENTRY_HIDDENATTRIBUTES];

        if ($includeInternals === true) {
            foreach ($this as $key => $value) {
                if ($key[0] === '_' && 0 !== strpos($key, '__') && !in_array($key, $nonInternals, true)) {
                    $data[$key] = $value;
                }
            }
        }

        if ($ignoreHiddenAttributes === false) {
            $data = $this->filterHiddenAttributes($data, $_hiddenAttributes);
        }

        if (null !== $this->_key) {
            $data['_key'] = $this->_key;
        }

        return $data;
    }