Add the serializeData function. Each time a simple attribute are saved this function will be called. So each simple attributed is able to manipulate the data before the data are writen into the database.