src/Entity/Brand.php line 13
<?phpnamespace App\Entity;use App\Repository\BrandRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;#[ORM\Entity(repositoryClass: BrandRepository::class)]#[UniqueEntity(fields: ['brand_name'], message: 'Il existe déjà une marque avec ce nom.')]class Brand{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255, unique: true)]private ?string $brand_name = null;#[ORM\OneToMany(mappedBy: 'model_brand', targetEntity: Model::class)]private Collection $models;#[ORM\ManyToOne(inversedBy: 'brands')]#[ORM\JoinColumn(nullable: false)]private ?BrandLogo $brand_logo = null;public function __construct(){$this->models = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getBrandName(): ?string{return $this->brand_name;}public function setBrandName(string $brand_name): self{$this->brand_name = $brand_name;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->add($model);$model->setModelBrand($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->getModelBrand() === $this) {$model->setModelBrand(null);}}return $this;}public function getBrandLogo(): ?BrandLogo{return $this->brand_logo;}public function setBrandLogo(?BrandLogo $brand_logo): self{$this->brand_logo = $brand_logo;return $this;}public function getBrandLogoImage(): ?string{return $this->brand_logo->getBrandLogoImage();}public function __toString(): string{return $this->brand_name;}}