<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity(repositoryClass="App\Repository\NewsRepository")
*
* @ORM\Table(
* name="news",
* indexes={
*
* @ORM\Index(columns={"type"})
* }
* )
*/
class News
{
public const TYPE_B2C = 'B2C';
public const TYPE_B2B = 'B2B';
/**
* @ORM\Id
*
* @ORM\Column(type="bigint")
*
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(type="string")
*
* @Gedmo\Translatable
*/
protected $title;
/**
* @ORM\Column(type="string")
*/
protected $image;
/**
* @ORM\Column(type="string")
*/
protected $link;
/**
* Locale.
*
* @Gedmo\Locale
*/
protected $locale;
/** @var array */
private $translations;
public function __construct(
/**
* @ORM\Column(type="string")
*/
protected $type
) {
}
public static function getAvailableTypes()
{
return [
self::TYPE_B2C,
self::TYPE_B2B,
];
}
public function getId()
{
return $this->id;
}
public function getTitle()
{
return $this->title;
}
public function setTitle($title): void
{
$this->title = $title;
}
public function getLink()
{
return $this->link;
}
public function setLink($link): void
{
$this->link = $link;
}
public function getImage()
{
return $this->image;
}
public function setImage($image): void
{
$this->image = $image;
}
public function getType()
{
return $this->type;
}
public function setType($type): void
{
$this->type = $type;
}
public function getLocale()
{
return $this->locale;
}
public function setLocale($locale): void
{
$this->locale = $locale;
}
public function setTranslatableLocale($locale): void
{
$this->locale = $locale;
}
public function setTranslations(array $translations): void
{
$this->translations = $translations;
}
}