src/Entity/Transaction.php line 12
<?phpnamespace App\Entity;use App\Repository\TransactionRepository;use App\Trait\DateTrait;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Serializer\Annotation\Groups;#[ORM\Entity(repositoryClass: TransactionRepository::class)]class Transaction{use DateTrait;const STATUS_ERROR = 0;const STATUS_SUCCESS = 1;const STATUS_PENDING = 3;const STATUS_CANCEL = 4;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(nullable: true)]private ?\DateTimeImmutable $responsedAt = null;#[ORM\Column(length: 15)]#[Groups('transaction:new')]private ?string $phone = null;#[ORM\Column(length: 255)]private ?string $status = null;#[ORM\Column(length: 255)]private ?string $operator = null;#[ORM\Column]private ?float $amount = null;#[ORM\Column(length: 255)]private ?string $reference = null;#[ORM\Column(length: 255, nullable: true)]private ?string $providerReference = null;#[ORM\Column(length: 255, nullable: true)]private ?string $message = null;#[ORM\ManyToOne]private ?Currency $currency = null;#[ORM\OneToOne(inversedBy: 'transaction', cascade: ['persist', 'remove'])]private ?Order $orderCommand = null;public function __construct(){if (!$this->createdAt) $this->createdAt = new \DateTimeImmutable();$this->updatedAt = new \DateTimeImmutable();$this->reference = uniqid();}public function getId(): ?int{return $this->id;}public function getResponsedAt(): ?\DateTimeImmutable{return $this->responsedAt;}public function setResponsedAt(?\DateTimeImmutable $responsedAt): static{$this->responsedAt = $responsedAt;return $this;}public function getPhone(): ?string{return $this->phone;}public function setPhone(string $phone): static{$this->phone = $phone;return $this;}public function getStatus(): ?string{return $this->status;}public function setStatus(string $status): static{$this->status = $status;return $this;}public function getOperator(): ?string{return $this->operator;}public function setOperator(string $operator): static{$this->operator = $operator;return $this;}public function getAmount(): ?float{return $this->amount;}public function setAmount(float $amount): static{$this->amount = $amount;return $this;}public function getReference(): ?string{return $this->reference;}public function setReference(string $reference): static{$this->reference = $reference;return $this;}public function getProviderReference(): ?string{return $this->providerReference;}public function setProviderReference(?string $providerReference): static{$this->providerReference = $providerReference;return $this;}public function getMessage(): ?string{return $this->message;}public function setMessage(?string $message): static{$this->message = $message;return $this;}public function getCurrency(): ?Currency{return $this->currency;}public function setCurrency(?Currency $currency): static{$this->currency = $currency;return $this;}public function getOrderCommand(): ?Order{return $this->orderCommand;}public function setOrderCommand(?Order $orderCommand): static{$this->orderCommand = $orderCommand;return $this;}}