src/Entity/OtherPayments.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OtherPaymentsRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=OtherPaymentsRepository::class)
  7.  */
  8. class OtherPayments
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\Column(type="datetime")
  18.      */
  19.     private $date;
  20.     /**
  21.      * @ORM\Column(type="datetime", nullable=true)
  22.      */
  23.     private $datePaid;
  24.     /**
  25.      * @ORM\Column(type="string", length=255, nullable=true)
  26.      */
  27.     private $note;
  28.        /**
  29.      * @ORM\Column(type="boolean", nullable=true)
  30.      */
  31.     private $paid;
  32.     /**
  33.      * @ORM\Column(type="decimal", precision=15, scale=2, nullable=true)
  34.      */
  35.     private $amount;
  36.     /**
  37.      * @ORM\ManyToOne(targetEntity=SeasonPlayer::class, inversedBy="clubMonthlyPayments")
  38.      * @ORM\JoinColumn(nullable=false)
  39.      */
  40.     private $seasonplayer;
  41.     /**
  42.      * @ORM\ManyToOne(targetEntity=Season::class, inversedBy="clubMonthlyPayments")
  43.      * @ORM\JoinColumn(nullable=false)
  44.      */
  45.     private $season;
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getDate(): ?\DateTimeInterface
  51.     {
  52.         return $this->date;
  53.     }
  54.     public function setDate(\DateTimeInterface $date): self
  55.     {
  56.         $this->date $date;
  57.         return $this;
  58.     }
  59.     public function getDatePaid(): ?\DateTimeInterface
  60.     {
  61.         return $this->datePaid;
  62.     }
  63.     public function setDatePaid(?\DateTimeInterface $datePaid): self
  64.     {
  65.         $this->datePaid $datePaid;
  66.         return $this;
  67.     }
  68.     public function getNote(): ?string
  69.     {
  70.         return $this->note;
  71.     }
  72.     public function setNote(?string $note): self
  73.     {
  74.         $this->note $note;
  75.         return $this;
  76.     }
  77.     
  78.     public function getPaid(): ?bool
  79.     {
  80.         return $this->paid;
  81.     }
  82.     public function setPaid(?bool $paid): self
  83.     {
  84.         $this->paid $paid;
  85.         return $this;
  86.     }
  87.     public function getAmount(): ?string
  88.     {
  89.         return $this->amount;
  90.     }
  91.     public function setAmount(?string $amount): self
  92.     {
  93.         $this->amount $amount;
  94.         return $this;
  95.     }
  96.     public function getSeasonplayer(): ?SeasonPlayer
  97.     {
  98.         return $this->seasonplayer;
  99.     }
  100.     public function setSeasonplayer(?SeasonPlayer $seasonplayer): self
  101.     {
  102.         $this->seasonplayer $seasonplayer;
  103.         return $this;
  104.     }
  105.     public function getSeason(): ?Season
  106.     {
  107.         return $this->season;
  108.     }
  109.     public function setSeason(?Season $season): self
  110.     {
  111.         $this->season $season;
  112.         return $this;
  113.     }
  114.     public function __toArray()
  115.     {
  116.         return [
  117.             'id' => $this->id,
  118.             'seasonplayerId' => $this->seasonplayer->getId(),
  119.             'playerId' => $this->seasonplayer->getPlayer()->getId(),
  120.             'seasonId' => $this->season->getId(),
  121.             'name' => $this->seasonplayer->getPlayer()->getName(),
  122.             'date' => $this->date->format('Y-m-d'),
  123.             'datePaid' => $this->datePaid $this->datePaid->format('Y-m-d') : null,
  124.             'note' => $this->note,
  125.             'amount' => $this->amount,
  126.             'paid' => $this->paid true false,
  127.         ];
  128.     }
  129. }