<?phpnamespace App\Entity;use App\Repository\BrandRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=BrandRepository::class) * @ORM\HasLifecycleCallbacks() */class Brand{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $image; /** * @ORM\Column(type="datetime") */ private $createdAt; /** * @ORM\Column(type="datetime", nullable=true) */ private $updatedAt; /** * @ORM\OneToMany(targetEntity=Car::class, mappedBy="brand") */ private $carId; /** * @ORM\Column(type="integer", nullable=true) */ private $infoautoId; public function __construct() { $this->carId = 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 getImage(): ?string { return $this->image; } public function setImage(?string $image): self { $this->image = $image; return $this; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } /** * @ORM\PrePersist */ public function setCreatedAt(): self { $this->createdAt = new \DateTime(); return $this; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } /** * @ORM\PreUpdate */ public function setUpdatedAt(): self { $this->updatedAt = new \DateTime(); return $this; } /** * @return Collection|Car[] */ public function getCarId(): Collection { return $this->carId; } public function addCarId(Car $carId): self { if (!$this->carId->contains($carId)) { $this->carId[] = $carId; $carId->setBrand($this); } return $this; } public function removeCarId(Car $carId): self { if ($this->carId->removeElement($carId)) { // set the owning side to null (unless already changed) if ($carId->getBrand() === $this) { $carId->setBrand(null); } } return $this; } public function __toString() { return $this->name; } public function getInfoautoId(): ?int { return $this->infoautoId; } public function setInfoautoId(?int $infoautoId): self { $this->infoautoId = $infoautoId; return $this; }}