<?php
namespace App\Entity;
use App\Repository\NewsRepository;
use App\Traits\EntityDateTimeAbleTrait;
use App\Traits\SeoTrait;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
#[ORM\Entity(repositoryClass: NewsRepository::class)]
#[ORM\HasLifecycleCallbacks]
class News
{
const STATUS_ACTIVE = 1;
const STATUS_INACTIVE = 0;
use EntityDateTimeAbleTrait;
use SeoTrait;
/**
* @Gedmo\Locale
* Used locale to override Translation listener`s locale
* this is not a mapped field of entity metadata, just a simple property
*/
private $locale;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
/**
* @Gedmo\Translatable
*/
#[ORM\Column(type: 'string', length: 255)]
private ?string $title = null;
/**
* @Gedmo\Translatable
*/
#[ORM\Column(type: 'text', nullable: true)]
private ?string $description = null;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $content = null;
#[ORM\Column(type: 'integer')]
private ?int $status = null;
#[ORM\Column(type: 'integer')]
private ?int $priority = null;
#[ORM\OneToOne(targetEntity: Media::class, orphanRemoval: true, cascade: ['persist'])]
#[ORM\JoinColumn(nullable: true)]
private ?\App\Entity\Media $media = null;
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): self
{
$this->description = $description;
return $this;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(string $content): self
{
$this->content = $content;
return $this;
}
public function getStatus(): ?int
{
return $this->status;
}
public function setStatus(int $status): self
{
$this->status = $status;
return $this;
}
public function getPriority(): ?int
{
return $this->priority;
}
public function setPriority(int $priority): self
{
$this->priority = $priority;
return $this;
}
public function getMedia(): ?Media
{
return $this->media;
}
public function setMedia(?Media $media): self
{
$this->media = $media;
return $this;
}
}