<?phpnamespace App\Entity;use App\Repository\PackageCategoryRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use App\Traits\CreatedUpdatedTrait;/** * @ORM\Table(name="v_package_category") * @ORM\Entity(repositoryClass=PackageCategoryRepository::class) */class PackageCategory{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\Column(type="text", nullable=true) */ private $description; /** * @ORM\OneToMany(targetEntity=Package::class, mappedBy="category") */ private $packages; use CreatedUpdatedTrait; public function __construct() { $this->packages = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): self { $this->description = $description; return $this; } /** * @return Collection<int, Package> */ public function getPackages(): Collection { return $this->packages; } public function addPackage(Package $package): self { if (!$this->packages->contains($package)) { $this->packages[] = $package; $package->setCategory($this); } return $this; } public function removePackage(Package $package): self { if ($this->packages->removeElement($package)) { // set the owning side to null (unless already changed) if ($package->getCategory() === $this) { $package->setCategory(null); } } return $this; }}