src/Entity/Charge.php line 17
<?phpnamespace App\Entity;use App\Enum\AllocationMethod;use App\Repository\ChargeRepository;use App\Traits\TimeStampTrait;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use App\Enum\ChargeScope;use App\Enum\ChargeType;#[ORM\Entity(repositoryClass: ChargeRepository::class)]#[ORM\HasLifecycleCallbacks]class Charge{use TimeStampTrait;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(type: 'string', length: 255, enumType: ChargeType::class)]private ?ChargeType $chargeType = null;#[ORM\Column(type: 'string', length: 255, enumType: ChargeScope::class)]private ?ChargeScope $chargeScope = null;#[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 2, nullable: true)]private ?string $amount = null;#[ORM\ManyToOne(inversedBy: 'charges')]private ?Habitat $habitat = null;#[ORM\ManyToOne(inversedBy: 'charges')]private ?Residence $residence = null;#[ORM\OneToMany(mappedBy: 'charge', targetEntity: ChargeAllocation::class)]private Collection $chargeAllocations;#[ORM\Column(length: 255, nullable: true)]private ?string $description = null;#[ORM\Column(type: 'string', nullable: true, enumType: AllocationMethod::class)]private ?AllocationMethod $allocationMethod = null;#[ORM\Column(length: 25, nullable: true)]private ?string $month = null;#[ORM\Column(length: 25, nullable: true)]private ?string $year = null;#[ORM\ManyToOne(inversedBy: 'charges')]private ?Location $Location = null;#[ORM\ManyToOne(inversedBy: 'charges')]private ?Entreprise $marchand = null;#[ORM\Column(length: 255, nullable: true)]private ?string $code = null;#[ORM\Column]private ?bool $paid = null;#[ORM\Column(nullable: true)]private ?\DateTime $paidAt = null;#[ORM\ManyToOne(cascade: ['all'], fetch: 'EAGER', inversedBy: 'charges',)]private ?Payment $payment = null;public function __construct(){$this->chargeAllocations = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getChargeType(): ?ChargeType{return $this->chargeType;}public function setChargeType(?ChargeType $chargeType): self{$this->chargeType = $chargeType;return $this;}public function getChargeScope(): ?ChargeScope{return $this->chargeScope;}public function setChargeScope(?ChargeScope $scope): self{$this->chargeScope = $scope;return $this;}public function getAmount(): ?string{return $this->amount;}public function setAmount(?string $amount): static{$this->amount = $amount;return $this;}public function getHabitat(): ?Habitat{return $this->habitat;}public function setHabitat(?Habitat $habitat): static{$this->habitat = $habitat;return $this;}public function getResidence(): ?Residence{return $this->residence;}public function setResidence(?Residence $residence): static{$this->residence = $residence;return $this;}/*** @return Collection<int, ChargeAllocation>*/public function getChargeAllocations(): Collection{return $this->chargeAllocations;}public function addChargeAllocation(ChargeAllocation $chargeAllocation): static{if (!$this->chargeAllocations->contains($chargeAllocation)) {$this->chargeAllocations->add($chargeAllocation);$chargeAllocation->setCharge($this);}return $this;}public function removeChargeAllocation(ChargeAllocation $chargeAllocation): static{if ($this->chargeAllocations->removeElement($chargeAllocation)) {// set the owning side to null (unless already changed)if ($chargeAllocation->getCharge() === $this) {$chargeAllocation->setCharge(null);}}return $this;}public function getDescription(): ?string{return $this->description;}public function setDescription(?string $description): static{$this->description = $description;return $this;}public function getAllocationMethod(): ?AllocationMethod{return $this->allocationMethod;}public function setAllocationMethod(?AllocationMethod $method): self{$this->allocationMethod = $method;return $this;}public function getMonth(): ?string{return $this->month;}public function setMonth(?string $month): static{$this->month = $month;return $this;}public function getYear(): ?string{return $this->year;}public function setYear(?string $year): static{$this->year = $year;return $this;}public function getLocation(): ?Location{return $this->Location;}public function setLocation(?Location $Location): static{$this->Location = $Location;return $this;}public function getMarchand(): ?Entreprise{return $this->marchand;}public function setMarchand(?Entreprise $marchand): static{$this->marchand = $marchand;return $this;}public function getCode(): ?string{return $this->code;}public function setCode(?string $code): static{$this->code = $code;return $this;}public function isPaid(): ?bool{return $this->paid;}public function setPaid(bool $paid): static{$this->paid = $paid;return $this;}public function getPaidAt(): ?\DateTime{return $this->paidAt;}public function setPaidAt(?\DateTime $paidAt): static{$this->paidAt = $paidAt;return $this;}public function getPayment(): ?Payment{return $this->payment;}public function setPayment(?Payment $payment): static{$this->payment = $payment;return $this;}}