public static function CreatePaymentVoucher($payment) { $pmnt = new Voucher($payment->id, $payment->transactionType->name, $payment->transactionId, $payment->amount->amount, $payment->description, $payment->date, $payment->stamp); $pmnt->persist(); $pmnt->setSupplier($payment->supplierId); return $pmnt; }