public function __construct(PaymentInstruction $paymentInstruction, $amount) { $this->approvedAmount = 0.0; $this->approvingAmount = 0.0; $this->createdAt = new \DateTime(); $this->creditedAmount = 0.0; $this->creditingAmount = 0.0; $this->depositedAmount = 0.0; $this->depositingAmount = 0.0; $this->paymentInstruction = $paymentInstruction; $this->reversingApprovedAmount = 0.0; $this->reversingCreditedAmount = 0.0; $this->reversingDepositedAmount = 0.0; $this->state = self::STATE_NEW; $this->targetAmount = $amount; $this->transactions = new ArrayCollection(); $this->attentionRequired = false; $this->expired = false; $this->paymentInstruction->addPayment($this); }