src/PHPDish/Bundle/PaymentBundle/Service/PaymentManager.php
public function savePayment(PaymentInterface $payment)
    {
        //如果没有钱包
        if (!$payment->getWallet()) {
            $payment->setWallet($this->walletManager->getUserWallet($payment->getUser()));
        }
        $this->entityManager->persist($payment);
        $this->entityManager->flush();
    }
public function savePayment(PaymentInterface $payment)
    {
        //如果没有钱包
        if (!$payment->getWallet()) {
            $payment->setWallet($this->walletManager->getUserWallet($payment->getUser()));
        }
        $this->entityManager->persist($payment);
        $this->entityManager->flush();
    }
{@inheritdoc}