<?php
namespace Roothirsch\Tuer24Bundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[ORM\Entity]
#[ORM\Table(name: 'roothirsch_tuer24_product_translation')]
#[ORM\UniqueConstraint(name: 'tuer24_product_translation_unique', columns: ['product_id', 'locale'])]
#[UniqueEntity(fields: ['product', 'locale'])]
class Tuer24ProductTranslation
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\ManyToOne(targetEntity: Tuer24Product::class, inversedBy: 'translations')]
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
private $product;
#[ORM\Column(type: 'string', length: 5)]
#[Assert\NotBlank]
#[Assert\Language]
private $locale;
#[ORM\Column(type: 'string', length: 255)]
#[Assert\NotBlank]
#[Assert\Length(max: 255)]
private $title;
#[ORM\Column(type: 'text', nullable: true)]
private $shortDescription;
#[ORM\Column(type: 'text', nullable: true)]
private $description;
/**
* Get id
*
* @return int|null
*/
public function getId(): ?int
{
return $this->id;
}
/**
* Get product
*
* @return Tuer24Product|null
*/
public function getProduct(): ?Tuer24Product
{
return $this->product;
}
/**
* Set product
*
* @param Tuer24Product|null $product
* @return $this
*/
public function setProduct(?Tuer24Product $product): self
{
$this->product = $product;
return $this;
}
/**
* Get locale
*
* @return string|null
*/
public function getLocale(): ?string
{
return $this->locale;
}
/**
* Set locale
*
* @param string $locale
* @return $this
*/
public function setLocale(string $locale): self
{
$this->locale = $locale;
return $this;
}
/**
* Get title
*
* @return string|null
*/
public function getTitle(): ?string
{
return $this->title;
}
/**
* Set title
*
* @param string $title
* @return $this
*/
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
/**
* Get short description
*
* @return string|null
*/
public function getShortDescription(): ?string
{
return $this->shortDescription;
}
/**
* Set short description
*
* @param string|null $shortDescription
* @return $this
*/
public function setShortDescription(?string $shortDescription): self
{
$this->shortDescription = $shortDescription;
return $this;
}
/**
* Get description
*
* @return string|null
*/
public function getDescription(): ?string
{
return $this->description;
}
/**
* Set description
*
* @param string|null $description
* @return $this
*/
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
}