src/Entity/News.php line 15
<?phpnamespace App\Entity;use App\Entity\Trait\MainTranslationTrait;use App\Entity\Translation\NewsTranslation;use App\Repository\NewsRepository;use Doctrine\ORM\Mapping as ORM;use Gedmo\Mapping\Annotation as Gedmo;use Gedmo\Translatable\Translatable;#[Gedmo\TranslationEntity(class: self::TRANSLATION_ENTITY)]#[ORM\Entity(repositoryClass: NewsRepository::class)]#[ORM\HasLifecycleCallbacks]class News implements Translatable{use MainTranslationTrait;const TRANSLATION_ENTITY = NewsTranslation::class;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(type: 'integer', nullable: true)]private ?int $type;#[ORM\Column(type: 'string', nullable: true)]#[Gedmo\Translatable]private ?string $title;#[ORM\Column(type: 'string', nullable: true)]private ?string $image;#[ORM\Column(type: 'string', length: 65, nullable: true)]#[Gedmo\Translatable]private ?string $metaTitle = null;#[ORM\Column(type: 'string', length: 165, nullable: true)]#[Gedmo\Translatable]private ?string $metaDescription = null;#[ORM\Column(type: 'string', nullable: true)]private ?string $metaImage = null;#[ORM\Column(type: 'text', nullable: true)]#[Gedmo\Translatable]private mixed $description;#[ORM\Column(type: 'string', nullable: true)]#[Gedmo\Translatable]private ?string $shortDescription;#[ORM\Column(type: 'datetime', nullable: true)]private ?\DateTimeInterface $createdAt = null;#[ORM\PrePersist]public function onPrePersist(): void{$now = new \DateTimeImmutable();if ($this->createdAt === null) {$this->createdAt = $now;}}public function getId(): ?int{return $this->id;}/*** @return int|null*/public function getType(): ?int{return $this->type;}/*** @param int|null $type*/public function setType(?int $type): void{$this->type = $type;}/*** @return string|null*/public function getTitle(): ?string{return $this->title;}/*** @param string|null $title*/public function setTitle(?string $title): void{$this->title = $title;}/*** @return string|null*/public function getImage(): ?string{return $this->image;}/*** @param string|null $image*/public function setImage(?string $image): void{$this->image = $image;}/*** @return string|null*/public function getMetaTitle(): ?string{return $this->metaTitle;}/*** @param string|null $metaTitle*/public function setMetaTitle(?string $metaTitle): void{$this->metaTitle = $metaTitle;}/*** @return string|null*/public function getMetaDescription(): ?string{return $this->metaDescription;}/*** @param string|null $metaDescription*/public function setMetaDescription(?string $metaDescription): void{$this->metaDescription = $metaDescription;}/*** @return string|null*/public function getMetaImage(): ?string{return $this->metaImage;}/*** @param string|null $metaImage*/public function setMetaImage(?string $metaImage): void{$this->metaImage = $metaImage;}/*** @return mixed*/public function getDescription(): mixed{return $this->description;}/*** @param mixed $description*/public function setDescription(mixed $description): void{$this->description = $description;}/*** @return string|null*/public function getShortDescription(): ?string{return $this->shortDescription;}/*** @param string|null $shortDescription*/public function setShortDescription(?string $shortDescription): void{$this->shortDescription = $shortDescription;}/*** @return \DateTimeInterface|null*/public function getCreatedAt(): ?\DateTimeInterface{return $this->createdAt;}/*** @param \DateTimeInterface|null $createdAt*/public function setCreatedAt(?\DateTimeInterface $createdAt): void{$this->createdAt = $createdAt;}}