protected function serializeAdditionalData(array $attr)
    {

        // serialize the additional data value if available
        if (isset($attr[MemberNames::ADDITIONAL_DATA]) && $attr[MemberNames::ADDITIONAL_DATA] !== null) {
            $attr[MemberNames::ADDITIONAL_DATA] = json_encode($attr[MemberNames::ADDITIONAL_DATA]);
        }

        // return the attribute
        return $attr;
    }