src/Entity/Package.php line 12
<?phpnamespace App\Entity;use App\Repository\PackageRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: PackageRepository::class)]class Package{public function __toString(): string{return $this->name;}#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\OneToMany(mappedBy: 'package', targetEntity: PackageFeatures::class, cascade: ["persist", "remove"])]protected Collection $packageFeatures;#[ORM\Column(type: 'string')]private string $name;#[ORM\Column(type: 'json', nullable: true)]private array|null $info = null;#[ORM\Column(type: 'decimal')]private ?string $price;public function __construct(){$this->packageFeatures = new ArrayCollection();$this->info = ['type' => null,'sub_info' => null,'feature_info' => null,'features' => []];}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 getPrice(): ?string{return $this->price;}public function setPrice(string $price): static{$this->price = $price;return $this;}public function getPackageFeatures(): Collection{return $this->packageFeatures;}public function addPackageFeature(PackageFeatures $packageFeature): static{if (!$this->packageFeatures->contains($packageFeature)) {$this->packageFeatures->add($packageFeature);$packageFeature->setPackage($this);}return $this;}public function removePackageFeature(PackageFeatures $packageFeature): static{if ($this->packageFeatures->removeElement($packageFeature)) {// set the owning side to null (unless already changed)if ($packageFeature->getPackage() === $this) {$packageFeature->setPackage(null);}}return $this;}public function getInfo(): ?array{return $this->info;}public function setInfo(?array $info): void{$this->info = $info;}}