src/Entity/Accounts.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\AccountsRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use ApiPlatform\Metadata\ApiFilter;
  9. use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
  10. use Symfony\Component\Serializer\Annotation\Groups;
  11. use Symfony\Component\Serializer\Annotation\MaxDepth;
  12. use ApiPlatform\Core\Annotation\ApiProperty;
  13. #[ORM\Entity(repositoryClassAccountsRepository::class)]
  14. #[ApiResource(
  15.     normalizationContext: ['groups' => ['Acc:read']],
  16.     denormalizationContext: ['groups' => ['Acc:write']],
  17.     order: ['id' => 'DESC'],
  18. )]
  19. class Accounts
  20. {
  21.     #[ORM\Id]
  22.     #[ORM\GeneratedValue]
  23.     #[ORM\Column]
  24.     #[Groups(['Acc:read'])]
  25.     private ?int $id null;
  26.     #[Groups(['Acc:read''personalAcc:read'])]
  27.     #[ORM\Column(length100nullabletrue)]
  28.     private ?string $number null;
  29.     #[ORM\OneToMany(mappedBy'accounts'targetEntityAppPersonalAccount::class)]
  30.     private Collection $appPersonalAccounts;
  31.     #[Groups(['Acc:read''personalAcc:read'])]
  32.     #[ORM\Column(length100nullabletrue)]
  33.     private ?string $statusLight null;
  34.     #[Groups(['Acc:read''personalAcc:read'])]
  35.     #[ORM\Column(length100nullabletrue)]
  36.     private ?string $statusPlanning null;
  37.     #[Groups(['Acc:read''personalAcc:read'])]
  38.     #[ORM\Column(length100nullabletrue)]
  39.     private ?string $eic null;
  40.     #[Groups(['Acc:read''personalAcc:read'])]
  41.     #[ORM\Column(length100nullabletrue)]
  42.     private ?string $eicParent null;
  43.     public function __construct()
  44.     {
  45.         $this->appPersonalAccounts = new ArrayCollection();
  46.     }
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getNumber(): ?string
  52.     {
  53.         return $this->number;
  54.     }
  55.     public function setNumber(?string $number): static
  56.     {
  57.         $this->number $number;
  58.         return $this;
  59.     }
  60.     /**
  61.      * @return Collection<int, AppPersonalAccount>
  62.      */
  63.     public function getAppPersonalAccounts(): Collection
  64.     {
  65.         return $this->appPersonalAccounts;
  66.     }
  67.     public function addAppPersonalAccount(AppPersonalAccount $appPersonalAccount): static
  68.     {
  69.         if (!$this->appPersonalAccounts->contains($appPersonalAccount)) {
  70.             $this->appPersonalAccounts->add($appPersonalAccount);
  71.             $appPersonalAccount->setAccounts($this);
  72.         }
  73.         return $this;
  74.     }
  75.     public function removeAppPersonalAccount(AppPersonalAccount $appPersonalAccount): static
  76.     {
  77.         if ($this->appPersonalAccounts->removeElement($appPersonalAccount)) {
  78.             // set the owning side to null (unless already changed)
  79.             if ($appPersonalAccount->getAccounts() === $this) {
  80.                 $appPersonalAccount->setAccounts(null);
  81.             }
  82.         }
  83.         return $this;
  84.     }
  85.     public function getStatusLight(): ?string
  86.     {
  87.         return $this->statusLight;
  88.     }
  89.     public function setStatusLight(?string $statusLight): static
  90.     {
  91.         $this->statusLight $statusLight;
  92.         return $this;
  93.     }
  94.     public function getStatusPlanning(): ?string
  95.     {
  96.         return $this->statusPlanning;
  97.     }
  98.     public function setStatusPlanning(?string $statusPlanning): static
  99.     {
  100.         $this->statusPlanning $statusPlanning;
  101.         return $this;
  102.     }
  103.     public function getEic(): ?string
  104.     {
  105.         return $this->eic;
  106.     }
  107.     public function setEic(?string $eic): static
  108.     {
  109.         $this->eic $eic;
  110.         return $this;
  111.     }
  112.     public function getEicParent(): ?string
  113.     {
  114.         return $this->eicParent;
  115.     }
  116.     public function setEicParent(?string $eicParent): static
  117.     {
  118.         $this->eicParent $eicParent;
  119.         return $this;
  120.     }
  121. }