src/Entity/Payment.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PaymentRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Enum\Payment\Type as PaymentType;
  6. /**
  7.  * @ORM\Entity(repositoryClass=PaymentRepository::class)
  8.  */
  9. class Payment
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $amount;
  21.     /**
  22.      * @ORM\Column(type="datetime")
  23.      */
  24.     private $createdAt;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity=CalendarEvent::class)
  27.      */
  28.     private $calendarEvent;
  29.     /**
  30.      * @ORM\Column(type="text", nullable=true)
  31.      */
  32.     private $comment;
  33.     /**
  34.      * @ORM\Column(type="datetime")
  35.      */
  36.     private $dateTime;
  37.     /**
  38.      * @ORM\ManyToOne(targetEntity=User::class)
  39.      * @ORM\JoinColumn(nullable=false)
  40.      */
  41.     private $createdBy;
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity=Person::class)
  44.      * @ORM\JoinColumn(nullable=false)
  45.      */
  46.     private $person;
  47.     /**
  48.      * @ORM\Column(type="string", length=255, nullable=true)
  49.      */
  50.     private $receiptFile;
  51.     /**
  52.      * @var string
  53.      */
  54.     private $newReceiptFile;
  55.     /**
  56.      * @ORM\Column(type="enum", nullable=true, options={"values"="payment_enum"})
  57.      */
  58.     private $type;
  59.     public function __construct()
  60.     {
  61.         $this->createdAt = new \DateTime();
  62.         // $this->dateTime = new \DateTime();
  63.     }
  64.     public function getId(): ?int
  65.     {
  66.         return $this->id;
  67.     }
  68.     public function getAmount(): ?int
  69.     {
  70.         return $this->amount;
  71.     }
  72.     public function setAmount(int $amount): self
  73.     {
  74.         $this->amount $amount;
  75.         return $this;
  76.     }
  77.     public function getCreatedAt(): ?\DateTimeInterface
  78.     {
  79.         return $this->createdAt;
  80.     }
  81.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  82.     {
  83.         $this->createdAt $createdAt;
  84.         return $this;
  85.     }
  86.     public function getCalendarEvent(): ?CalendarEvent
  87.     {
  88.         return $this->calendarEvent;
  89.     }
  90.     public function setCalendarEvent(?CalendarEvent $calendarEvent): self
  91.     {
  92.         $this->calendarEvent $calendarEvent;
  93.         return $this;
  94.     }
  95.     public function getComment(): ?string
  96.     {
  97.         return $this->comment;
  98.     }
  99.     public function setComment(?string $comment): self
  100.     {
  101.         $this->comment $comment;
  102.         return $this;
  103.     }
  104.     public function getDateTime(): ?\DateTimeInterface
  105.     {
  106.         return $this->dateTime;
  107.     }
  108.     public function setDateTime(\DateTimeInterface $dateTime): self
  109.     {
  110.         $this->dateTime $dateTime;
  111.         return $this;
  112.     }
  113.     public function getCreatedBy(): ?User
  114.     {
  115.         return $this->createdBy;
  116.     }
  117.     public function setCreatedBy(?User $createdBy): self
  118.     {
  119.         $this->createdBy $createdBy;
  120.         return $this;
  121.     }
  122.     public function getPerson(): ?Person
  123.     {
  124.         return $this->person;
  125.     }
  126.     public function setPerson(?Person $person): self
  127.     {
  128.         $this->person $person;
  129.         return $this;
  130.     }
  131.     public function getReceiptFile(): ?string
  132.     {
  133.         return $this->receiptFile;
  134.     }
  135.     public function setReceiptFile(?string $receiptFile): self
  136.     {
  137.         $this->receiptFile $receiptFile;
  138.         return $this;
  139.     }
  140.     public function getNewReceiptFile(): ?string
  141.     {
  142.         return $this->newReceiptFile;
  143.     }
  144.     public function setNewReceiptFile(?string $newReceiptFile): self
  145.     {
  146.         $this->newReceiptFile $newReceiptFile;
  147.         return $this;
  148.     }
  149.     public function getType()
  150.     {
  151.         return $this->type;
  152.     }
  153.     public function setType($type): self
  154.     {
  155.         $this->type $type;
  156.         return $this;
  157.     }
  158.     public function getTypeText(): ?string
  159.     {
  160.         return PaymentType::getText($this->getType());
  161.     }
  162.     public function getTypeCssClass($prefix null): ?string
  163.     {
  164.         return PaymentType::getCssClass($this->getType(), $prefix);
  165.     }
  166. }