src/Entity/Dealer.php line 28
<?phpnamespace App\Entity;use ApiPlatform\Metadata\ApiResource;use ApiPlatform\Metadata\GetCollection;use ApiPlatform\Metadata\Tests\Fixtures\Metadata\Get;use App\Entity\Enum\ImportVehicleType;use App\Repository\DealerRepository;use App\Repository\VehicleRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\String\Slugger\AsciiSlugger;use Symfony\Component\Validator\Constraints\Email;use Symfony\Component\Validator\Constraints\NotBlank;#[ApiResource(operations: [new GetCollection(),new Get(),],)]#[ORM\Entity(repositoryClass: DealerRepository::class)]class Dealer{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[NotBlank]#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\Column(options: ['default' => false])]private bool $authSeller = false;#[ORM\Column(length: 255, nullable: true)]private ?string $city = null;#[ORM\Column(length: 255, nullable: true)]private ?string $street = null;#[ORM\Column]private ?bool $checkVin = null;#[ORM\Column(nullable: true)]private ?bool $visible = null;#[ORM\Column(nullable: true)]private ?bool $basicAdvertising = null;#[Email]#[ORM\Column(length: 255, nullable: true)]private ?string $email = null;#[ORM\Column(length: 255, nullable: true)]private ?string $www = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $description = null;#[ORM\Column(nullable: true)]private ?float $lng = null;#[ORM\Column(nullable: true)]private ?float $lat = null;#[ORM\Column(nullable: true)]private ?int $rank = null;#[ORM\OrderBy(['main' => 'DESC'])]#[ORM\OneToMany(mappedBy: 'dealer', targetEntity: DealerImage::class, cascade: ['persist', 'remove'])]private Collection $dealerImages;#[ORM\OneToMany(mappedBy: 'dealer', targetEntity: DealerPhone::class, cascade: ['persist', 'remove'])]private Collection $dealerPhones;#[ORM\OneToMany(mappedBy: 'dealer', targetEntity: DealerOpenHour::class, cascade: ['persist', 'remove'])]private Collection $dealerOpenHours;#[ORM\Column(nullable: true)]private ?string $logo = null;#[ORM\Column(nullable: true)]private ?int $importId = null;#[ORM\ManyToOne(inversedBy: 'dealers')]private ?District $district = null;#[ORM\Column(length: 255, nullable: true, enumType: ImportVehicleType::class)]private ?ImportVehicleType $nameImportVehicle = null;#[ORM\Column(length: 255, nullable: true)]private ?string $idImportVehicle = null;#[ORM\OneToMany(mappedBy: 'dealer', targetEntity: DealerImport::class)]private Collection $dealerImports;#[ORM\OneToMany(mappedBy: 'dealer', targetEntity: Vehicle::class)]private Collection $vehicles;#[ORM\Column(length: 255)]private ?string $url = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $openingHoursNote = null;public function __construct(){$this->dealerImages = new ArrayCollection();$this->dealerPhones = new ArrayCollection();$this->dealerOpenHours = new ArrayCollection();$this->dealerImports = new ArrayCollection();$this->vehicles = new ArrayCollection();}public function getId(): ?int{return $this->id;}/*** @return string|null*/public function getLogo(): ?string{return $this->logo;}/*** @param string|null $logo*/public function setLogo(?string $logo): void{$this->logo = $logo;}public function getName(): ?string{return $this->name;}public function setName(string $name): self{$this->name = $name;return $this;}public function isAuthSeller(): bool{return $this->authSeller;}public function setAuthSeller(bool $authSeller): self{$this->authSeller = $authSeller;return $this;}public function getCity(): ?string{return $this->city;}public function setCity(string $city): self{$this->city = $city;return $this;}public function isCheckVin(): ?bool{return $this->checkVin;}public function setCheckVin(bool $checkVin): self{$this->checkVin = $checkVin;return $this;}public function isVisible(): ?bool{return $this->visible;}public function setVisible(bool $visible): self{$this->visible = $visible;return $this;}public function isBasicAdvertising(): ?bool{return $this->basicAdvertising;}public function setBasicAdvertising(?bool $basicAdvertising): self{$this->basicAdvertising = $basicAdvertising;return $this;}public function getEmail(): ?string{return $this->email;}public function setEmail(string $email): self{$this->email = $email;return $this;}public function getWww(): ?string{return $this->www;}public function setWww(?string $www): self{$this->www = $www;return $this;}public function getDescription(): ?string{return $this->description;}public function setDescription(?string $description): self{$this->description = $description;return $this;}public function getLng(): ?float{return $this->lng;}public function setLng(float $lng): self{$this->lng = $lng;return $this;}public function getLat(): ?float{return $this->lat;}public function setLat(float $lat): self{$this->lat = $lat;return $this;}public function getRank(): ?int{return $this->rank;}public function setRank(?int $rank): self{$this->rank = $rank;return $this;}/*** @return Collection<int, DealerImage>*/public function getDealerImages(): Collection{return $this->dealerImages;}public function addDealerImage(DealerImage $dealerImage): self{if (!$this->dealerImages->contains($dealerImage)) {$this->dealerImages->add($dealerImage);$dealerImage->setDealer($this);}return $this;}public function removeDealerImage(DealerImage $dealerImage): self{if ($this->dealerImages->removeElement($dealerImage)) {// set the owning side to null (unless already changed)if ($dealerImage->getDealer() === $this) {$dealerImage->setDealer(null);}}return $this;}/*** @return Collection<int, DealerPhone>*/public function getDealerPhones(): Collection{return $this->dealerPhones;}public function addDealerPhone(DealerPhone $dealerPhone): self{if (!$this->dealerPhones->contains($dealerPhone)) {$this->dealerPhones->add($dealerPhone);$dealerPhone->setDealer($this);}return $this;}public function removeDealerPhone(DealerPhone $dealerPhone): self{if ($this->dealerPhones->removeElement($dealerPhone)) {// set the owning side to null (unless already changed)if ($dealerPhone->getDealer() === $this) {$dealerPhone->setDealer(null);}}return $this;}/*** @return Collection<int, DealerOpenHour>*/public function getDealerOpenHours(): Collection{return $this->dealerOpenHours;}public function addDealerOpenHour(DealerOpenHour $dealerOpenHour): self{if (!$this->dealerOpenHours->contains($dealerOpenHour)) {$this->dealerOpenHours->add($dealerOpenHour);$dealerOpenHour->setDealer($this);}return $this;}public function removeDealerOpenHour(DealerOpenHour $dealerOpenHour): self{if ($this->dealerOpenHours->removeElement($dealerOpenHour)) {// set the owning side to null (unless already changed)if ($dealerOpenHour->getDealer() === $this) {$dealerOpenHour->setDealer(null);}}return $this;}public function getImportId(): ?int{return $this->importId;}public function setImportId(?int $importId): self{$this->importId = $importId;return $this;}public function getStreet(): ?string{return $this->street;}public function setStreet(string $street): self{$this->street = $street;return $this;}public function getDistrict(): ?District{return $this->district;}public function setDistrict(?District $district): self{$this->district = $district;return $this;}public function getNameImportVehicle(): ?ImportVehicleType{return $this->nameImportVehicle;}public function setNameImportVehicle(?ImportVehicleType $nameImportVehicle): self{$this->nameImportVehicle = $nameImportVehicle;return $this;}public function getIdImportVehicle(): ?string{return $this->idImportVehicle;}public function setIdImportVehicle(?string $idImportVehicle): self{$this->idImportVehicle = $idImportVehicle;return $this;}/*** @return Collection<int, DealerImport>*/public function getDealerImports(): Collection{return $this->dealerImports;}public function addDealerImport(DealerImport $dealerImport): self{if (!$this->dealerImports->contains($dealerImport)) {$this->dealerImports->add($dealerImport);$dealerImport->setDealer($this);}return $this;}public function removeDealerImport(DealerImport $dealerImport): self{if ($this->dealerImports->removeElement($dealerImport)) {// set the owning side to null (unless already changed)if ($dealerImport->getDealer() === $this) {$dealerImport->setDealer(null);}}return $this;}/*** @return Collection<int, Vehicle>*/public function getVehicles(): Collection{return $this->vehicles;}public function addVehicle(Vehicle $vehicle): self{if (!$this->vehicles->contains($vehicle)) {$this->vehicles->add($vehicle);$vehicle->setDealer($this);}return $this;}public function removeVehicle(Vehicle $vehicle): self{if ($this->vehicles->removeElement($vehicle)) {// set the owning side to null (unless already changed)if ($vehicle->getDealer() === $this) {$vehicle->setDealer(null);}}return $this;}public function getUrl(): ?string{return $this->url;}public function setUrl(string $url): self{if($url) {$slugger = new AsciiSlugger('cs');$slug = $slugger->slug($url, '-')->lower();$this->url = $slug->toString();} else {$this->url = null;}return $this;}public function getOpeningHoursNote(): ?string{return $this->openingHoursNote;}public function setOpeningHoursNote(?string $openingHoursNote): self{$this->openingHoursNote = $openingHoursNote;return $this;}}