src/Entity/Content/NewsType.php line 12
<?php
namespace App\Entity\Content;
use App\Entity\Traits\ActiveTrait;
use App\Entity\Traits\DeletedTrait;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'news_type')]
#[ORM\Entity(repositoryClass: 'App\Repository\Content\NewsTypeRepository')]
class NewsType
{
use DeletedTrait;
use ActiveTrait;
public const TYPE_NEWS='news';
public const TYPE_EVENT='event';
/**
* @var int|null
*/
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
#[ORM\Column(type: 'integer')]
private $id;
/**
* @var string|null
*/
#[ORM\Column(type: 'string')]
private $caption;
/**
* @var string|null
*/
#[ORM\Column(type: 'string')]
private $slug;
/**
* @var Collection|News[]
*/
#[ORM\OneToMany(targetEntity: 'App\Entity\Content\News', mappedBy: 'type')]
private $news;
/**
* @var string
*/
#[ORM\Column(type: 'string', length: 10, nullable: false)]
private $type;
/**
* @return int|null
*/
public function getId(): ?int
{
return $this->id;
}
/**
* @param int|null $id
*/
public function setId(?int $id): void
{
$this->id = $id;
}
/**
* @return string|null
*/
public function getCaption(): ?string
{
return $this->caption;
}
/**
* @param string|null $caption
*/
public function setCaption(?string $caption): void
{
$this->caption = $caption;
}
/**
* @return News[]|Collection
*/
public function getNews()
{
return $this->news;
}
/**
* @param News[]|Collection $news
*/
public function setNews($news): void
{
$this->news = $news;
}
/**
* @return string|null
*/
public function getSlug(): ?string
{
return $this->slug;
}
/**
* @param string|null $slug
*/
public function setSlug(?string $slug): void
{
$this->slug = $slug;
}
/**
* @return string
*/
public function getType(): ?string
{
return $this->type;
}
/**
* @param string $type
*/
public function setType(string $type): void
{
$this->type = $type;
}
}