src/Entity/Company.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\CompanyRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClassCompanyRepository::class)]
  10. #[ApiResource]
  11. class Company
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\Column(length255nullabletrue)]
  18.     private ?string $name null;
  19.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  20.     private ?string $description null;
  21.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  22.     private ?\DateTimeInterface $dateEntered null;
  23.     #[ORM\Column(length255nullabletrue)]
  24.     private ?string $url null;
  25.     #[ORM\Column(nullabletrue)]
  26.     private ?bool $active null;
  27.     #[ORM\Column(length100nullabletrue)]
  28.     private ?string $edrpou null;
  29.     #[ORM\OneToMany(mappedBy'company'targetEntityAppPersonalAccount::class)]
  30.     private Collection $appPersonalAccounts;
  31.     public function __construct()
  32.     {
  33.         $this->appPersonalAccounts = new ArrayCollection();
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getName(): ?string
  40.     {
  41.         return $this->name;
  42.     }
  43.     public function setName(?string $name): static
  44.     {
  45.         $this->name $name;
  46.         return $this;
  47.     }
  48.     public function getDescription(): ?string
  49.     {
  50.         return $this->description;
  51.     }
  52.     public function setDescription(?string $description): static
  53.     {
  54.         $this->description $description;
  55.         return $this;
  56.     }
  57.     public function getDateEntered(): ?\DateTimeInterface
  58.     {
  59.         return $this->dateEntered;
  60.     }
  61.     public function setDateEntered(?\DateTimeInterface $dateEntered): static
  62.     {
  63.         $this->dateEntered $dateEntered;
  64.         return $this;
  65.     }
  66.     public function getUrl(): ?string
  67.     {
  68.         return $this->url;
  69.     }
  70.     public function setUrl(?string $url): static
  71.     {
  72.         $this->url $url;
  73.         return $this;
  74.     }
  75.     public function isActive(): ?bool
  76.     {
  77.         return $this->active;
  78.     }
  79.     public function setActive(?bool $active): static
  80.     {
  81.         $this->active $active;
  82.         return $this;
  83.     }
  84.     public function getEdrpou(): ?string
  85.     {
  86.         return $this->edrpou;
  87.     }
  88.     public function setEdrpou(?string $edrpou): static
  89.     {
  90.         $this->edrpou $edrpou;
  91.         return $this;
  92.     }
  93.     /**
  94.      * @return Collection<int, AppPersonalAccount>
  95.      */
  96.     public function getAppPersonalAccounts(): Collection
  97.     {
  98.         return $this->appPersonalAccounts;
  99.     }
  100.     public function addAppPersonalAccount(AppPersonalAccount $appPersonalAccount): static
  101.     {
  102.         if (!$this->appPersonalAccounts->contains($appPersonalAccount)) {
  103.             $this->appPersonalAccounts->add($appPersonalAccount);
  104.             $appPersonalAccount->setCompany($this);
  105.         }
  106.         return $this;
  107.     }
  108.     public function removeAppPersonalAccount(AppPersonalAccount $appPersonalAccount): static
  109.     {
  110.         if ($this->appPersonalAccounts->removeElement($appPersonalAccount)) {
  111.             // set the owning side to null (unless already changed)
  112.             if ($appPersonalAccount->getCompany() === $this) {
  113.                 $appPersonalAccount->setCompany(null);
  114.             }
  115.         }
  116.         return $this;
  117.     }
  118. }