uuid = Uuid::v4()->toRfc4122(); $this->user = $user; $this->amountRials = $amountRials; $this->type = $type; $this->balanceAfter = $balanceAfter; $this->createdAt = time(); } public function getId(): ?int { return $this->id; } public function getUuid(): string { return $this->uuid; } public function getUser(): User { return $this->user; } public function getPayment(): ?Payment { return $this->payment; } public function getAmountRials(): int { return $this->amountRials; } public function getType(): string { return $this->type; } public function getDescription(): ?string { return $this->description; } public function getBalanceAfter(): int { return $this->balanceAfter; } public function getCreatedBy(): ?User { return $this->createdBy; } public function getCreatedByName(): ?string { return $this->createdByName; } public function getPaymentMethod(): ?string { return $this->paymentMethod; } public function getReference(): ?string { return $this->reference; } public function getStatus(): string { return $this->status; } public function setPayment(?Payment $p): self { $this->payment = $p; return $this; } public function setDescription(?string $d): self { $this->description = $d; return $this; } public function setCreatedBy(?User $u): self { $this->createdBy = $u; return $this; } public function setCreatedByName(?string $n): self { $this->createdByName = $n; return $this; } public function setPaymentMethod(?string $m): self { $this->paymentMethod = $m; return $this; } public function setReference(?string $r): self { $this->reference = $r; return $this; } public function setStatus(string $s): self { $this->status = $s; return $this; } public function toArray(): array { return [ 'uuid' => $this->uuid, 'amount_rials' => $this->amountRials, 'type' => $this->type, 'description' => $this->description, 'balance_after' => $this->balanceAfter, 'created_by_name' => $this->createdByName, 'payment_method' => $this->paymentMethod, 'reference' => $this->reference, 'status' => $this->status, 'created_at' => $this->createdAt, ]; } }