src/Entity/Garages/GarageService.php line 34

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Garages;
  3. use App\Annotation\SiteAware;
  4. use App\Entity\AbstractBase;
  5. use App\Entity\Interfaces\ImageInterface;
  6. use App\Entity\Interfaces\PublishedInterface;
  7. use App\Entity\Interfaces\SiteInterface;
  8. use App\Entity\Interfaces\SlugInterface;
  9. use App\Entity\MiniAbstractBase;
  10. use App\Entity\News\NewsTag;
  11. use App\Entity\Traits\DescriptionTrait;
  12. use App\Entity\Traits\HasImageTrait;
  13. use App\Entity\Traits\NameTrait;
  14. use App\Entity\Traits\PublishedTrait;
  15. use App\Entity\Traits\SiteTrait;
  16. use App\Entity\Traits\SlugTrait;
  17. use App\Repository\Garages\GarageServiceRepository;
  18. use Doctrine\ORM\Mapping as ORM;
  19. use Gedmo\Mapping\Annotation as Gedmo;
  20. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  21. use Symfony\Component\HttpFoundation\File\File;
  22. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  23. /**
  24.  * @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"})})
  25.  * @ORM\Entity(repositoryClass=GarageServiceRepository::class)
  26.  * @Gedmo\SoftDeleteable(fieldName="removedAt", timeAware=false)
  27.  * @SiteAware(siteFieldName="site")
  28.  * @Vich\Uploadable
  29.  * @UniqueEntity("slug")
  30.  */
  31. class GarageService extends AbstractBase implements SiteInterfaceSlugInterfacePublishedInterfaceImageInterface
  32. {
  33.     use DescriptionTrait;
  34.     use HasImageTrait;
  35.     use NameTrait;
  36.     use PublishedTrait;
  37.     use SiteTrait;
  38.     use SlugTrait;
  39.     /**
  40.      * @Vich\UploadableField(mapping="garage_service_image", fileNameProperty="imageName")
  41.      */
  42.     private ?File $image null;
  43.     /**
  44.      * @ORM\Column(type="string", length=200, nullable=false)
  45.      */
  46.     private string $name;
  47.     /**
  48.      * @ORM\Column(type="string", length=200, nullable=true)
  49.      * TODO: Ya no se utiliza
  50.      */
  51.     private ?string $nameCa null;
  52.     /**
  53.      * @ORM\Column(type="string", length=255, nullable=false)
  54.      * @Gedmo\Slug(fields={"name"}, unique=false, updatable=false)
  55.      */
  56.     private string $slug;
  57.     /**
  58.      * @ORM\Column(type="text", length=10000, nullable=true)
  59.      * TODO: Ya no se utiliza
  60.      */
  61.     private ?string $description null;
  62.     /**
  63.      * @ORM\Column(type="text", length=10000, nullable=true)
  64.      * TODO: Ya no se utiliza
  65.      */
  66.     private ?string $shortDescription null;
  67.     /**
  68.      * @ORM\Column(type="text", length=10000, nullable=true)
  69.      * TODO: Ya no se utiliza
  70.      */
  71.     private ?string $shortDescriptionCa null;
  72.     /**
  73.      * @ORM\Column(type="integer", name="ordenation", options={"default": 0})
  74.      */
  75.     private int $order 0;
  76.     /**
  77.      * var ArrayCollection[News].
  78.      */
  79.     // TODO private $news;
  80.     /**
  81.      * @ORM\ManyToOne(targetEntity="App\Entity\News\NewsTag", fetch="EAGER")
  82.      * @ORM\JoinColumn(name="tag_id", referencedColumnName="id")
  83.      */
  84.     private ?NewsTag $tag null;
  85.     public function __construct()
  86.     {
  87.         // TODO $this->news = new ArrayCollection();
  88.     }
  89.     public function getNameCa(): ?string
  90.     {
  91.         return $this->nameCa;
  92.     }
  93.     public function setNameCa(?string $nameCa): self
  94.     {
  95.         $this->nameCa $nameCa;
  96.         return $this;
  97.     }
  98.     public function getShortDescription(): ?string
  99.     {
  100.         return $this->shortDescription;
  101.     }
  102.     public function setShortDescription(?string $shortDescription): self
  103.     {
  104.         $this->shortDescription $shortDescription;
  105.         return $this;
  106.     }
  107.     public function getShortDescriptionCa(): ?string
  108.     {
  109.         return $this->shortDescriptionCa;
  110.     }
  111.     public function setShortDescriptionCa(?string $shortDescriptionCa): self
  112.     {
  113.         $this->shortDescriptionCa $shortDescriptionCa;
  114.         return $this;
  115.     }
  116.     public function getOrder(): int
  117.     {
  118.         return $this->order;
  119.     }
  120.     public function setOrder(int $order): self
  121.     {
  122.         $this->order $order;
  123.         return $this;
  124.     }
  125.     public function getTag(): ?NewsTag
  126.     {
  127.         return $this->tag;
  128.     }
  129.     public function setTag(?NewsTag $tag): self
  130.     {
  131.         $this->tag $tag;
  132.         return $this;
  133.     }
  134.     public function __toString(): string
  135.     {
  136.         return $this->id $this->getName() : MiniAbstractBase::DEFAULT_EMPTY_STRING;
  137.     }
  138. }