<?php
namespace App\Entity\Garages;
use App\Annotation\SiteAware;
use App\Entity\AbstractBase;
use App\Entity\Interfaces\ImageInterface;
use App\Entity\Interfaces\PublishedInterface;
use App\Entity\Interfaces\SiteInterface;
use App\Entity\Interfaces\SlugInterface;
use App\Entity\MiniAbstractBase;
use App\Entity\News\NewsTag;
use App\Entity\Traits\DescriptionTrait;
use App\Entity\Traits\HasImageTrait;
use App\Entity\Traits\NameTrait;
use App\Entity\Traits\PublishedTrait;
use App\Entity\Traits\SiteTrait;
use App\Entity\Traits\SlugTrait;
use App\Repository\Garages\GarageServiceRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Table(name="vulco_garage_service", indexes={@ORM\Index(name="garage_service_site_idx", columns={"site"})}, uniqueConstraints={@ORM\UniqueConstraint(name="garage_service_search_idx", columns={"site", "slug"})})
* @ORM\Entity(repositoryClass=GarageServiceRepository::class)
* @Gedmo\SoftDeleteable(fieldName="removedAt", timeAware=false)
* @SiteAware(siteFieldName="site")
* @Vich\Uploadable
* @UniqueEntity("slug")
*/
class GarageService extends AbstractBase implements SiteInterface, SlugInterface, PublishedInterface, ImageInterface
{
use DescriptionTrait;
use HasImageTrait;
use NameTrait;
use PublishedTrait;
use SiteTrait;
use SlugTrait;
/**
* @Vich\UploadableField(mapping="garage_service_image", fileNameProperty="imageName")
*/
private ?File $image = null;
/**
* @ORM\Column(type="string", length=200, nullable=false)
*/
private string $name;
/**
* @ORM\Column(type="string", length=200, nullable=true)
* TODO: Ya no se utiliza
*/
private ?string $nameCa = null;
/**
* @ORM\Column(type="string", length=255, nullable=false)
* @Gedmo\Slug(fields={"name"}, unique=false, updatable=false)
*/
private string $slug;
/**
* @ORM\Column(type="text", length=10000, nullable=true)
* TODO: Ya no se utiliza
*/
private ?string $description = null;
/**
* @ORM\Column(type="text", length=10000, nullable=true)
* TODO: Ya no se utiliza
*/
private ?string $shortDescription = null;
/**
* @ORM\Column(type="text", length=10000, nullable=true)
* TODO: Ya no se utiliza
*/
private ?string $shortDescriptionCa = null;
/**
* @ORM\Column(type="integer", name="ordenation", options={"default": 0})
*/
private int $order = 0;
/**
* var ArrayCollection[News].
*/
// TODO private $news;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\News\NewsTag", fetch="EAGER")
* @ORM\JoinColumn(name="tag_id", referencedColumnName="id")
*/
private ?NewsTag $tag = null;
public function __construct()
{
// TODO $this->news = new ArrayCollection();
}
public function getNameCa(): ?string
{
return $this->nameCa;
}
public function setNameCa(?string $nameCa): self
{
$this->nameCa = $nameCa;
return $this;
}
public function getShortDescription(): ?string
{
return $this->shortDescription;
}
public function setShortDescription(?string $shortDescription): self
{
$this->shortDescription = $shortDescription;
return $this;
}
public function getShortDescriptionCa(): ?string
{
return $this->shortDescriptionCa;
}
public function setShortDescriptionCa(?string $shortDescriptionCa): self
{
$this->shortDescriptionCa = $shortDescriptionCa;
return $this;
}
public function getOrder(): int
{
return $this->order;
}
public function setOrder(int $order): self
{
$this->order = $order;
return $this;
}
public function getTag(): ?NewsTag
{
return $this->tag;
}
public function setTag(?NewsTag $tag): self
{
$this->tag = $tag;
return $this;
}
public function __toString(): string
{
return $this->id ? $this->getName() : MiniAbstractBase::DEFAULT_EMPTY_STRING;
}
}