src/Parameter/EventListener/Entity/Parameter/Serializer/PreFlushListener.php
public function preFlush(PreFlushEventArgs $args)
    {
        $entities = $args->getEntityManager()->getUnitOfWork()->getScheduledEntityInsertions();

        foreach ($entities as $entity) {
            if (!$entity instanceof Parameter) {
                continue;
            }

            $entity->setValue(serialize($entity->getValue()));
        }
    }
public function preFlush(PreFlushEventArgs $args)
    {
        $entities = $args->getEntityManager()->getUnitOfWork()->getScheduledEntityInsertions();

        foreach ($entities as $entity) {
            if (!$entity instanceof Parameter) {
                continue;
            }

            $entity->setValue(serialize($entity->getValue()));
        }
    }
Serialize parameter entity value property before saving to storage.

@param \Doctrine\ORM\Event\PreFlushEventArgs $args