public function pay(Money $paidAmount) { if (self::PAID === $this->status) { throw new OrderAlreadyPaidException(); } if (!$paidAmount->equals($this->totalAmount)) { throw new OrderPartiallyPaidException(); } $this->status = self::PAID; } }
designation VARCHAR(255) NOT NULL, unit_price VARCHAR(10) NOT NULL COMMENT '(DC2Type:money)', quantity SMALLINT NOT NULL, gross_amount VARCHAR(10) NOT NULL COMMENT '(DC2Type:money)', vat_amount VARCHAR(10) NOT NULL COMMENT '(DC2Type:money)', total_amount VARCHAR(10) NOT NULL COMMENT '(DC2Type:money)', status VARCHAR(15) NOT NULL, PRIMARY KEY(uuid) );