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

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

            $key = $entity->getKey();
            $encrypt = $this->parameterCollection->get($key)['encrypt'];
            $entity->setEncrypt($encrypt);
        }
    }
public function preFlush(PreFlushEventArgs $args)
    {
        $entities = $args->getEntityManager()->getUnitOfWork()->getScheduledEntityInsertions();

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

            $key = $entity->getKey();
            $encrypt = $this->parameterCollection->get($key)['encrypt'];
            $entity->setEncrypt($encrypt);
        }
    }
Set parameter entity encrypt property before saving in storage.

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