src/Entity/Blog.php line 14
<?phpnamespace App\Entity;use App\Repository\BlogRepository;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;#[ORM\Entity(repositoryClass: BlogRepository::class)]#[ORM\Index(name: "url_idx", columns: ["url"])]class Blog{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\ManyToMany(targetEntity: BlogKind::class, inversedBy: 'blogs')]private Collection $kinds;#[ORM\ManyToOne]private ?BlogKind $mainKind = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\Column(length: 255, nullable: true)]private ?string $url = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $description = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $text = null;#[ORM\Column(length: 255, nullable: true)]private ?string $keyword = null;#[ORM\Column(length: 255, nullable: true)]private ?string $textSource = null;#[ORM\Column]private ?bool $visible = null;#[ORM\Column]private ?bool $visibleHomepage = null;#[ORM\Column]private ?\DateTime $createAt = null;#[ORM\ManyToOne(inversedBy: 'blogs')]private ?VehicleManufacturer $vehicleManufacturer = null;#[ORM\ManyToOne(inversedBy: 'blogs')]private ?VehicleModel $vehicleModel = null;#[ORM\Column(nullable: true)]private ?int $importId = null;#[ORM\OrderBy(['main' => 'DESC', 'id' => 'ASC'])]#[ORM\OneToMany(mappedBy: 'blog', targetEntity: BlogImage::class, cascade: ['persist', 'remove'])]private Collection $blogImages;#[ORM\Column(nullable: true)]private ?bool $top = null;#[ORM\Column(length: 255, nullable: true)]private ?string $redirect = null;public function __construct(){$this->kinds = new ArrayCollection();$this->blogImages = new ArrayCollection();}public function getId(): ?int{return $this->id;}/*** @return Collection<int, BlogKind>*/public function getKinds(): Collection{return $this->kinds;}public function addKind(BlogKind $kind): self{if (!$this->kinds->contains($kind)) {$this->kinds->add($kind);}return $this;}public function removeKind(BlogKind $kind): self{$this->kinds->removeElement($kind);return $this;}public function getMainKind(): ?BlogKind{return $this->mainKind;}public function setMainKind(?BlogKind $mainKind): self{$this->mainKind = $mainKind;return $this;}public function getName(): ?string{return $this->name;}public function setName(string $name): self{$this->name = $name;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 getDescription(): ?string{return $this->description;}public function setDescription(?string $description): self{$this->description = $description;return $this;}public function getText(): ?string{return $this->text;}public function setText(?string $text): self{$this->text = $text;return $this;}public function getKeyword(): ?string{return $this->keyword;}public function setKeyword(?string $keyword): self{$this->keyword = $keyword;return $this;}public function getTextSource(): ?string{return $this->textSource;}public function setTextSource(?string $textSource): self{$this->textSource = $textSource;return $this;}public function isVisible(): ?bool{return $this->visible;}public function setVisible(bool $visible): self{$this->visible = $visible;return $this;}public function isVisibleHomepage(): ?bool{return $this->visibleHomepage;}public function setVisibleHomepage(bool $visibleHomepage): self{$this->visibleHomepage = $visibleHomepage;return $this;}public function getCreateAt(): ?\DateTime{return $this->createAt;}public function setCreateAt(\DateTime $createAt): self{$this->createAt = $createAt;return $this;}public function getVehicleManufacturer(): ?VehicleManufacturer{return $this->vehicleManufacturer;}public function setVehicleManufacturer(?VehicleManufacturer $vehicleManufacturer): self{$this->vehicleManufacturer = $vehicleManufacturer;return $this;}public function getVehicleModel(): ?VehicleModel{return $this->vehicleModel;}public function setVehicleModel(?VehicleModel $vehicleModel): self{$this->vehicleModel = $vehicleModel;return $this;}public function getImportId(): ?int{return $this->importId;}public function setImportId(?int $importId): self{$this->importId = $importId;return $this;}/*** @return Collection<int, BlogImage>*/public function getBlogImages(): Collection{return $this->blogImages;}public function addBlogImage(BlogImage $blogImage): self{if (!$this->blogImages->contains($blogImage)) {$this->blogImages->add($blogImage);$blogImage->setBlog($this);}return $this;}public function removeBlogImage(BlogImage $blogImage): self{if ($this->blogImages->removeElement($blogImage)) {// set the owning side to null (unless already changed)if ($blogImage->getBlog() === $this) {$blogImage->setBlog(null);}}return $this;}public function isTop(): ?bool{return $this->top;}public function setTop(?bool $top): self{$this->top = $top;return $this;}public function getRedirect(): ?string{return $this->redirect;}public function setRedirect(?string $redirect): self{$this->redirect = $redirect;return $this;}}