<?phpnamespace App\Entity;use App\Repository\ManufacturerRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=ManufacturerRepository::class) */class Manufacturer{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=128) */ private $name; /** * @ORM\Column(type="integer", nullable=true) */ private $wttId; /** * @ORM\OneToMany(targetEntity=Model::class, mappedBy="manufacturer") */ private $models; public function __construct() { $this->products = new ArrayCollection(); $this->models = new ArrayCollection(); } public function __toString() { return $this->getName(); } 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 getWttId(): ?int { return $this->wttId; } public function setWttId(int $wttId): self { $this->wttId = $wttId; return $this; } /** * @return Collection<int, Model> */ public function getModels(): Collection { return $this->models; } public function addModel(Model $model): self { if (!$this->models->contains($model)) { $this->models[] = $model; $model->setManufacturer($this); } return $this; } public function removeModel(Model $model): self { if ($this->models->removeElement($model)) { // set the owning side to null (unless already changed) if ($model->getManufacturer() === $this) { $model->setManufacturer(null); } } return $this; }}