src/Entity/ClientDebit.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ClientDebitRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassClientDebitRepository::class)]
  8. #[ORM\Table(name'tb_clients_debit')]
  9. #[ORM\HasLifecycleCallbacks]
  10. class ClientDebit
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column(type"integer"uniquetrue)]
  15.     private ?int $id;
  16.     #[ORM\Column(type'string'length50nullabletrue)]
  17.     private ?string $compteNumber;
  18.     #[ORM\Column(type'string'length50nullabletrue)]
  19.     private ?string $compteCode;
  20.     #[ORM\Column(type'string'length50nullabletrue)]
  21.     private ?string $compteGlobal;
  22.     #[ORM\Column(type'decimal'precision10scale0nullabletrue)]
  23.     private ?string $amount;
  24.     #[ORM\Column(type'string'length20nullabletrue)]
  25.     private ?string $currency;
  26.     #[ORM\Column(type'date'nullabletrue)]
  27.     private ?\DateTimeInterface $period;
  28.     #[ORM\Column(type'boolean'nullabletrue)]
  29.     private ?bool $paid;
  30.     #[ORM\Column(type'integer'nullabletrue)]
  31.     private ?int $type;
  32.     #[ORM\Column(type'datetime'nullabletrue)]
  33.     private ?\DateTimeInterface $createdAt;
  34.     #[ORM\Column(type'datetime'nullabletrue)]
  35.     private ?\DateTimeInterface $modifiedAt;
  36.     #[ORM\ManyToOne(targetEntityUser::class)]
  37.     private ?User $validatedBy;
  38.     #[ORM\Column(type'boolean'nullabletrue)]
  39.     private ?bool $deleted;
  40.     #[ORM\OneToMany(mappedBy'clientDebit'targetEntityClientDebitAccount::class)]
  41.     private Collection $clientDebitAccounts;
  42.     #[ORM\ManyToOne(targetEntityAppAccount::class, inversedBy'clientDebits')]
  43.     private $appAccount;
  44.     #[ORM\OneToMany(mappedBy'clientDebit'targetEntityClientDebitRequest::class)]
  45.     private Collection $clientDebitRequests;
  46.     #[ORM\Column(type'string'length50nullabletrue)]
  47.     private ?string $code;
  48.     public function __construct()
  49.     {
  50.         $this->clientDebitAccounts = new ArrayCollection();
  51.         $this->clientDebitRequests = new ArrayCollection();
  52.     }
  53.     public function getId(): ?int
  54.     {
  55.         return $this->id;
  56.     }
  57.     /**
  58.      * @return mixed
  59.      */
  60.     public function getAppAccount()
  61.     {
  62.         return $this->appAccount;
  63.     }
  64.     /**
  65.      * @param mixed $appAccount
  66.      */
  67.     public function setAppAccount($appAccount): void
  68.     {
  69.         $this->appAccount $appAccount;
  70.     }
  71.     public function getCompteNumber(): ?string
  72.     {
  73.         return $this->compteNumber;
  74.     }
  75.     public function setCompteNumber(?string $compteNumber): self
  76.     {
  77.         $this->compteNumber $compteNumber;
  78.         return $this;
  79.     }
  80.     public function getCompteCode(): ?string
  81.     {
  82.         return $this->compteCode;
  83.     }
  84.     public function setCompteCode(?string $compteCode): self
  85.     {
  86.         $this->compteCode $compteCode;
  87.         return $this;
  88.     }
  89.     public function getCompteGlobal(): ?string
  90.     {
  91.         return $this->compteGlobal;
  92.     }
  93.     public function setCompteGlobal(?string $compteGlobal): self
  94.     {
  95.         $this->compteGlobal $compteGlobal;
  96.         return $this;
  97.     }
  98.     public function getAmount(): ?string
  99.     {
  100.         return $this->amount;
  101.     }
  102.     public function setAmount(?string $amount): self
  103.     {
  104.         $this->amount $amount;
  105.         return $this;
  106.     }
  107.     public function getCurrency(): ?string
  108.     {
  109.         return $this->currency;
  110.     }
  111.     public function setCurrency(?string $currency): self
  112.     {
  113.         $this->currency $currency;
  114.         return $this;
  115.     }
  116.     public function getPeriod(): ?\DateTimeInterface
  117.     {
  118.         return $this->period;
  119.     }
  120.     public function setPeriod(?\DateTimeInterface $period): self
  121.     {
  122.         $this->period $period;
  123.         return $this;
  124.     }
  125.     public function getPaid(): ?bool
  126.     {
  127.         return $this->paid;
  128.     }
  129.     public function setPaid(?bool $paid): self
  130.     {
  131.         $this->paid $paid;
  132.         return $this;
  133.     }
  134.     public function getType(): ?int
  135.     {
  136.         return $this->type;
  137.     }
  138.     public function setType(?int $type): self
  139.     {
  140.         $this->type $type;
  141.         return $this;
  142.     }
  143.     public function getCreatedAt(): ?\DateTimeInterface
  144.     {
  145.         return $this->createdAt;
  146.     }
  147.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  148.     {
  149.         $this->createdAt $createdAt;
  150.         return $this;
  151.     }
  152.     public function getModifiedAt(): ?\DateTimeInterface
  153.     {
  154.         return $this->modifiedAt;
  155.     }
  156.     public function setModifiedAt(?\DateTimeInterface $modifiedAt): self
  157.     {
  158.         $this->modifiedAt $modifiedAt;
  159.         return $this;
  160.     }
  161.     public function getValidatedBy(): ?User
  162.     {
  163.         return $this->validatedBy;
  164.     }
  165.     public function setValidatedBy(?User $validatedBy): self
  166.     {
  167.         $this->validatedBy $validatedBy;
  168.         return $this;
  169.     }
  170.     /**
  171.      * @ORM\PreUpdate
  172.      */
  173.     public function onUpdate() {
  174.         $this->modifiedAt = new \DateTime();
  175.     }
  176.     public function getDeleted(): ?bool
  177.     {
  178.         return $this->deleted;
  179.     }
  180.     public function setDeleted(?bool $deleted): self
  181.     {
  182.         $this->deleted $deleted;
  183.         return $this;
  184.     }
  185.     /**
  186.      * @return Collection|ClientDebitAccount[]
  187.      */
  188.     public function getClientDebitAccounts(): Collection
  189.     {
  190.         return $this->clientDebitAccounts;
  191.     }
  192.     public function addClientDebitAccount(ClientDebitAccount $clientDebitAccount): self
  193.     {
  194.         if (!$this->clientDebitAccounts->contains($clientDebitAccount)) {
  195.             $this->clientDebitAccounts[] = $clientDebitAccount;
  196.             $clientDebitAccount->setClientDebit($this);
  197.         }
  198.         return $this;
  199.     }
  200.     public function removeClientDebitAccount(ClientDebitAccount $clientDebitAccount): self
  201.     {
  202.         if ($this->clientDebitAccounts->removeElement($clientDebitAccount)) {
  203.             // set the owning side to null (unless already changed)
  204.             if ($clientDebitAccount->getClientDebit() === $this) {
  205.                 $clientDebitAccount->setClientDebit(null);
  206.             }
  207.         }
  208.         return $this;
  209.     }
  210.     /**
  211.      * @return Collection|ClientDebitRequest[]
  212.      */
  213.     public function getClientDebitRequests(): Collection
  214.     {
  215.         return $this->clientDebitRequests;
  216.     }
  217.     public function addClientDebitRequest(ClientDebitRequest $clientDebitRequest): self
  218.     {
  219.         if (!$this->clientDebitRequests->contains($clientDebitRequest)) {
  220.             $this->clientDebitRequests[] = $clientDebitRequest;
  221.             $clientDebitRequest->setClientDebit($this);
  222.         }
  223.         return $this;
  224.     }
  225.     public function removeClientDebitRequest(ClientDebitRequest $clientDebitRequest): self
  226.     {
  227.         if ($this->clientDebitRequests->removeElement($clientDebitRequest)) {
  228.             // set the owning side to null (unless already changed)
  229.             if ($clientDebitRequest->getClientDebit() === $this) {
  230.                 $clientDebitRequest->setClientDebit(null);
  231.             }
  232.         }
  233.         return $this;
  234.     }
  235.     public function getCode(): ?string
  236.     {
  237.         return $this->code;
  238.     }
  239.     public function setCode(string $code): self
  240.     {
  241.         $this->code $code;
  242.         return $this;
  243.     }
  244. }