<?php
namespace App\Entity;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Translatable\Translatable;
use App\Repository\DeliveryRepository;
use App\Entity\Translation\PageTranslation;
use App\Entity\Translation\DeliveryTranslation;
use Gedmo\Mapping\Annotation\TranslationEntity;
use Doctrine\Common\Collections\ArrayCollection;
use Gedmo\Mapping\Annotation\Locale as GedmoLocale;
use Gedmo\Mapping\Annotation\Translatable as GedmoTranslatable;
#[ORM\Entity(repositoryClass: DeliveryRepository::class)]
#[TranslationEntity(class: DeliveryTranslation::class)]
class Delivery implements EntityInterface
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $intname = null;
#[GedmoTranslatable]
#[ORM\Column(length: 255)]
private ?string $name = null;
#[GedmoTranslatable]
#[ORM\Column(type: Types::TEXT)]
private ?string $cont = null;
#[ORM\Column(type: Types::SMALLINT)]
private ?int $prior = null;
#[ORM\Column]
private ?int $price = null;
#[ORM\Column]
private array $fields = [];
#[ORM\Column]
private ?bool $visible = null;
#[GedmoLocale]
private $locale;
#[ORM\OneToMany(targetEntity: DeliveryTranslation::class, mappedBy: 'object', cascade: ['persist', 'remove'])]
private $translations;
public function __construct()
{
$this->translations = new ArrayCollection();
}
public function setLocale($locale)
{
$this->locale = $locale;
}
public function getTranslations()
{
return $this->translations;
}
public function addTranslation(DeliveryTranslation $t)
{
if (!$this->translations->contains($t)) {
$this->translations[] = $t;
$t->setObject($this);
}
}
public function getId(): ?int
{
return $this->id;
}
public function getIntname(): ?string
{
return $this->intname;
}
public function setIntname(string $intname): self
{
$this->intname = $intname;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getCont(): ?string
{
return $this->cont;
}
public function setCont(string $cont): self
{
$this->cont = $cont;
return $this;
}
public function getPrior(): ?int
{
return $this->prior;
}
public function setPrior(int $prior): self
{
$this->prior = $prior;
return $this;
}
public function getPrice(): ?int
{
return $this->price;
}
public function setPrice(int $price): self
{
$this->price = $price;
return $this;
}
public function getFields(): array
{
return $this->fields;
}
public function setFields(array $fields): self
{
$this->fields = $fields;
return $this;
}
public function isVisible(): ?bool
{
return $this->visible;
}
public function setVisible(bool $visible): self
{
$this->visible = $visible;
return $this;
}
}