What I want to do is give a possibility to the user to save as many images as he likes. For this, I have created a specific field type
$fields['photo_ids'] = BaseFieldDefinition::create('map')
->setLabel(t('Photos'))
->setDescription(t('The photo ids of the Item entity.'))
->setSettings([
'max_length' => 50,
'text_processing' => 0,
])
->setDefaultValue('');
here I want to save, add, delete IDs of pictures. Not sure if this is the best approach to this problem. The problem is I can't find the way in Drupal 8 to serialize/deserialize and save these data into the database;