<?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\MiniAbstractBase;
use App\Entity\Traits\HasImageTrait;
use App\Entity\Traits\NameTrait;
use App\Entity\Traits\PublishedTrait;
use App\Entity\Traits\SiteTrait;
use App\Repository\Garages\GarageFacilityRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Table(name="vulco_garage_facility", indexes={@ORM\Index(name="garage_facility_site_idx", columns={"site"})})
* @ORM\Entity(repositoryClass=GarageFacilityRepository::class)
* @Gedmo\SoftDeleteable(fieldName="removedAt", timeAware=false)
* @SiteAware(siteFieldName="site")
* @Vich\Uploadable
*/
class GarageFacility extends AbstractBase implements SiteInterface, PublishedInterface, ImageInterface
{
use HasImageTrait;
use NameTrait;
use PublishedTrait;
use SiteTrait;
/**
* @Vich\UploadableField(mapping="garage_facility_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="integer", name="ordenation", options={"default": 0})
*/
private int $order = 0;
public function __construct()
{
}
public function getNameCa(): ?string
{
return $this->nameCa;
}
public function setNameCa(?string $nameCa): self
{
$this->nameCa = $nameCa;
return $this;
}
public function getOrder(): int
{
return $this->order;
}
public function setOrder(int $order): self
{
$this->order = $order;
return $this;
}
public function __toString(): string
{
return $this->id ? $this->getName() : MiniAbstractBase::DEFAULT_EMPTY_STRING;
}
}