code: public function preUpdate(PreUpdateEventArgs $args)
      {
          $entity = $args->getEntity();
  
          if (!$entity instanceof Parameter) {
              return;
          }
  
          $entity->setValue(serialize($entity->getValue()));
      }
docs: Serialize parameter entity value property before saving in storage.
  
  @param \Doctrine\ORM\Event\PreUpdateEventArgs $args