<?phpnamespace App\Entity;use ApiPlatform\Metadata\ApiResource;use App\Repository\CompanyRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: CompanyRepository::class)]#[ApiResource]class Company{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255, nullable: true)] private ?string $name = null; #[ORM\Column(type: Types::TEXT, nullable: true)] private ?string $description = null; #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)] private ?\DateTimeInterface $dateEntered = null; #[ORM\Column(length: 255, nullable: true)] private ?string $url = null; #[ORM\Column(nullable: true)] private ?bool $active = null; #[ORM\Column(length: 100, nullable: true)] private ?string $edrpou = null; #[ORM\OneToMany(mappedBy: 'company', targetEntity: AppPersonalAccount::class)] private Collection $appPersonalAccounts; public function __construct() { $this->appPersonalAccounts = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(?string $name): static { $this->name = $name; return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): static { $this->description = $description; return $this; } public function getDateEntered(): ?\DateTimeInterface { return $this->dateEntered; } public function setDateEntered(?\DateTimeInterface $dateEntered): static { $this->dateEntered = $dateEntered; return $this; } public function getUrl(): ?string { return $this->url; } public function setUrl(?string $url): static { $this->url = $url; return $this; } public function isActive(): ?bool { return $this->active; } public function setActive(?bool $active): static { $this->active = $active; return $this; } public function getEdrpou(): ?string { return $this->edrpou; } public function setEdrpou(?string $edrpou): static { $this->edrpou = $edrpou; return $this; } /** * @return Collection<int, AppPersonalAccount> */ public function getAppPersonalAccounts(): Collection { return $this->appPersonalAccounts; } public function addAppPersonalAccount(AppPersonalAccount $appPersonalAccount): static { if (!$this->appPersonalAccounts->contains($appPersonalAccount)) { $this->appPersonalAccounts->add($appPersonalAccount); $appPersonalAccount->setCompany($this); } return $this; } public function removeAppPersonalAccount(AppPersonalAccount $appPersonalAccount): static { if ($this->appPersonalAccounts->removeElement($appPersonalAccount)) { // set the owning side to null (unless already changed) if ($appPersonalAccount->getCompany() === $this) { $appPersonalAccount->setCompany(null); } } return $this; }}