src/Entity/Donation.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DonationRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. /**
  7.  * @ORM\Entity(repositoryClass=DonationRepository::class)
  8.  */
  9. class Donation
  10. {
  11.     const STATUS = [
  12.         // "label" => "value", 
  13.         "nouveau" => "new",  // avant paiement en ligne
  14.         "en cours" => "progress",  // paiement en ligne initié
  15.         "payé" => "success"// paiement en ligne réussi
  16.         "en échec" => "fail"// paiement en ligne en échec
  17.         "annulé" => "cancel",   // paiement en ligne abandonné
  18.     ];
  19.     /**
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue
  22.      * @ORM\Column(type="integer")
  23.      */
  24.     private $id;
  25.     /**
  26.      * @ORM\Column(type="string", length=255)
  27.      */
  28.     private $status;
  29.     /**
  30.      * @ORM\Column(type="string", length=255)
  31.      */
  32.     private $name;
  33.     /**
  34.      * @ORM\Column(type="string", length=255)
  35.      */
  36.     private $surname;
  37.     /**
  38.      * @ORM\Column(type="string", length=255)
  39.      */
  40.     private $email;
  41.     /**
  42.      * @ORM\Column(type="integer")
  43.      */
  44.     private $amount;
  45.     /**
  46.      * @var \DateTime $createdAt
  47.      *
  48.      * @Gedmo\Timestampable(on="create")
  49.      * @ORM\Column(type="datetime", nullable=true)
  50.      */
  51.     private $createdAt;
  52.     /**
  53.      * @var \DateTime $updatedAt
  54.      *
  55.      * @Gedmo\Timestampable(on="update")
  56.      * @ORM\Column(type="datetime", nullable=true)
  57.      */
  58.     private $updatedAt;
  59.     public function __construct()
  60.     {
  61.         $this->status array_search("new"self::STATUS);
  62.     }
  63.     public function getId(): ?int
  64.     {
  65.         return $this->id;
  66.     }
  67.     public function getStatus(): ?string
  68.     {
  69.         return $this->status;
  70.     }
  71.     public function setStatus(string $status): self
  72.     {
  73.         $this->status $status;
  74.         return $this;
  75.     }
  76.     public function getName(): ?string
  77.     {
  78.         return $this->name;
  79.     }
  80.     public function setName(string $name): self
  81.     {
  82.         $this->name $name;
  83.         return $this;
  84.     }
  85.     public function getSurname(): ?string
  86.     {
  87.         return $this->surname;
  88.     }
  89.     public function setSurname(string $surname): self
  90.     {
  91.         $this->surname $surname;
  92.         return $this;
  93.     }
  94.     public function getEmail(): ?string
  95.     {
  96.         return $this->email;
  97.     }
  98.     public function setEmail(string $email): self
  99.     {
  100.         $this->email $email;
  101.         return $this;
  102.     }
  103.     public function getAmount(): ?int
  104.     {
  105.         return $this->amount;
  106.     }
  107.     public function setAmount(int $amount): self
  108.     {
  109.         $this->amount $amount;
  110.         return $this;
  111.     }
  112.     public function getCreatedAt(): ?\DateTimeInterface
  113.     {
  114.         return $this->createdAt;
  115.     }
  116.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  117.     {
  118.         $this->createdAt $createdAt;
  119.         return $this;
  120.     }
  121.     public function getUpdatedAt(): ?\DateTimeInterface
  122.     {
  123.         return $this->updatedAt;
  124.     }
  125.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  126.     {
  127.         $this->updatedAt $updatedAt;
  128.         return $this;
  129.     }
  130. }