<?php
namespace App\Entity;
use App\Repository\ClubMonthlyPaymentsRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ClubMonthlyPaymentsRepository::class)
*/
class ClubMonthlyPayments
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="datetime")
*/
private $date;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $datePaid;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $note;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $paid;
/**
* @ORM\Column(type="decimal", precision=15, scale=2, nullable=true)
*/
private $amount;
/**
* @ORM\ManyToOne(targetEntity=SeasonPlayer::class, inversedBy="clubMonthlyPayments")
* @ORM\JoinColumn(nullable=false)
*/
private $seasonplayer;
/**
* @ORM\ManyToOne(targetEntity=Season::class, inversedBy="clubMonthlyPayments")
* @ORM\JoinColumn(nullable=false)
*/
private $season;
public function getId(): ?int
{
return $this->id;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
public function getDatePaid(): ?\DateTimeInterface
{
return $this->datePaid;
}
public function setDatePaid(?\DateTimeInterface $datePaid): self
{
$this->datePaid = $datePaid;
return $this;
}
public function getNote(): ?string
{
return $this->note;
}
public function setNote(?string $note): self
{
$this->note = $note;
return $this;
}
public function getPaid(): ?bool
{
return $this->paid;
}
public function setPaid(?bool $paid): self
{
$this->paid = $paid;
return $this;
}
public function getAmount(): ?string
{
return $this->amount;
}
public function setAmount(?string $amount): self
{
$this->amount = $amount;
return $this;
}
public function getSeasonplayer(): ?SeasonPlayer
{
return $this->seasonplayer;
}
public function setSeasonplayer(?SeasonPlayer $seasonplayer): self
{
$this->seasonplayer = $seasonplayer;
return $this;
}
public function getSeason(): ?Season
{
return $this->season;
}
public function setSeason(?Season $season): self
{
$this->season = $season;
return $this;
}
public function __toArray()
{
return [
'id' => $this->id,
'seasonplayerId' => $this->seasonplayer->getId(),
'playerId' => $this->seasonplayer->getPlayer()->getId(),
'seasonId' => $this->season->getId(),
'name' => $this->seasonplayer->getPlayer()->getName(),
'date' => $this->date->format('Y-m-d'),
'datePaid' => $this->datePaid ? $this->datePaid->format('Y-m-d') : null,
'note' => $this->note,
'amount' => $this->amount,
'paid' => $this->paid ? true : false,
];
}
}