src/Entity/Donation.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DonationRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassDonationRepository::class)]
  7. #[ORM\HasLifecycleCallbacks]
  8. class Donation
  9. {
  10.     public const STATUS_ACTIVE 'AC';
  11.     public const STATUS_INACTIVE 'IN';
  12.     public const STATUS_PENDING 'PE';
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\ManyToOne(inversedBy'donations')]
  18.     private ?User $user null;
  19.     #[ORM\Column(length255)]
  20.     private ?string $firstName null;
  21.     #[ORM\Column(length255nullabletrue)]
  22.     private ?string $lastName null;
  23.     #[ORM\Column(length255)]
  24.     private ?string $email null;
  25.     #[ORM\Column]
  26.     private ?int $amount null;
  27.     #[ORM\Column(length255nullabletrue)]
  28.     private ?string $phoneNumber null;
  29.     #[ORM\Column(length255)]
  30.     private ?string $address null;
  31.     #[ORM\Column(length2)]
  32.     private ?string $donationStatus null;
  33.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  34.     private ?\DateTimeInterface $created null;
  35.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  36.     private ?\DateTimeInterface $updated null;
  37.     #[ORM\Column(nullabletrue)]
  38.     private ?int $updatedBy null;
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getUser(): ?User
  44.     {
  45.         return $this->user;
  46.     }
  47.     public function setUser(?User $user): static
  48.     {
  49.         $this->user $user;
  50.         return $this;
  51.     }
  52.     public function getFirstName(): ?string
  53.     {
  54.         return $this->firstName;
  55.     }
  56.     public function setFirstName(string $firstName): static
  57.     {
  58.         $this->firstName $firstName;
  59.         return $this;
  60.     }
  61.     public function getLastName(): ?string
  62.     {
  63.         return $this->lastName;
  64.     }
  65.     public function setLastName(?string $lastName): static
  66.     {
  67.         $this->lastName $lastName;
  68.         return $this;
  69.     }
  70.     public function getEmail(): ?string
  71.     {
  72.         return $this->email;
  73.     }
  74.     public function setEmail(string $email): static
  75.     {
  76.         $this->email $email;
  77.         return $this;
  78.     }
  79.     public function getPhoneNumber(): ?string
  80.     {
  81.         return $this->phoneNumber;
  82.     }
  83.     public function setPhoneNumber(?string $phoneNumber): static
  84.     {
  85.         $this->phoneNumber $phoneNumber;
  86.         return $this;
  87.     }
  88.     public function getAddress(): ?string
  89.     {
  90.         return $this->address;
  91.     }
  92.     public function setAddress(string $address): static
  93.     {
  94.         $this->address $address;
  95.         return $this;
  96.     }
  97.     public function getDonationStatus(): ?string
  98.     {
  99.         return $this->donationStatus;
  100.     }
  101.     public function setDonationStatus(string $donationStatus): static
  102.     {
  103.         $this->donationStatus $donationStatus;
  104.         return $this;
  105.     }
  106.     public function getCreated(): ?\DateTimeInterface
  107.     {
  108.         return $this->created;
  109.     }
  110.     #[ORM\PrePersist]
  111.     public function setCreatedTimestamp(): void
  112.     {
  113.         $this->created = new \DateTime();
  114.     }
  115.     public function setCreated(\DateTimeInterface $created): static
  116.     {
  117.         $this->created $created;
  118.         return $this;
  119.     }
  120.     #[ORM\PrePersist]
  121.     #[ORM\PreUpdate]
  122.     public function setUpdatedTimestamp(): void
  123.     {
  124.         $this->updated = new \DateTime();
  125.     }
  126.     public function getUpdated(): ?\DateTimeInterface
  127.     {
  128.         return $this->updated;
  129.     }
  130.     public function setUpdated(\DateTimeInterface $updated): static
  131.     {
  132.         $this->updated $updated;
  133.         return $this;
  134.     }
  135.     public function getUpdatedBy(): ?int
  136.     {
  137.         return $this->updatedBy;
  138.     }
  139.     public function setUpdatedBy(?int $updatedBy): static
  140.     {
  141.         $this->updatedBy $updatedBy;
  142.         return $this;
  143.     }
  144.     public function getAmount(): ?int
  145.     {
  146.         return $this->amount;
  147.     }
  148.     public function setAmount(?int $amount): void
  149.     {
  150.         $this->amount $amount;
  151.     }
  152. }