src/Entity/ManteApp.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Validator\Constraints as Assert;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. /**
  7.  * ManteApp
  8.  *
  9.  * @ORM\Table(name="mante_app")
  10.  * @ORM\Entity
  11.  * @UniqueEntity("code")
  12.  */
  13. class ManteApp
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue(strategy="AUTO")
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * Código interno de la app (venues, catering, av)
  23.      *
  24.      * @ORM\Column(type="string", length=50, unique=true)
  25.      * @Assert\NotBlank()
  26.      */
  27.     private $code;
  28.     /**
  29.      * Nombre visible (ManteVenues, ManteCatering, ManteAV)
  30.      *
  31.      * @ORM\Column(type="string", length=100)
  32.      * @Assert\NotBlank()
  33.      */
  34.     private $name;
  35.     /**
  36.      * Ruta al logo de la app, relativa a /public
  37.      *
  38.      * @ORM\Column(name="logo_path", type="string", length=255, nullable=true)
  39.      */
  40.     private $logoPath;
  41.     /**
  42.      * Color principal (por ejemplo #F29521)
  43.      *
  44.      * @ORM\Column(name="primary_color", type="string", length=20, nullable=true)
  45.      */
  46.     private $primaryColor;
  47.     /**
  48.      * Color secundario (opcional)
  49.      *
  50.      * @ORM\Column(name="secondary_color", type="string", length=20, nullable=true)
  51.      */
  52.     private $secondaryColor;
  53.     /**
  54.      * Imagen de fondo específica del login (opcional)
  55.      *
  56.      * @ORM\Column(name="login_background", type="string", length=255, nullable=true)
  57.      */
  58.     private $loginBackground;
  59.     /**
  60.      * Si la app está activa y se muestra en el portal inicial
  61.      *
  62.      * @ORM\Column(name="is_active", type="boolean")
  63.      */
  64.     private $isActive true;
  65.     public function getId()
  66.     {
  67.         return $this->id;
  68.     }
  69.     public function getCode(): ?string
  70.     {
  71.         return $this->code;
  72.     }
  73.     public function setCode(?string $code): self
  74.     {
  75.         $this->code $code;
  76.         return $this;
  77.     }
  78.     public function getName(): ?string
  79.     {
  80.         return $this->name;
  81.     }
  82.     public function setName(?string $name): self
  83.     {
  84.         $this->name $name;
  85.         return $this;
  86.     }
  87.     public function getLogoPath(): ?string
  88.     {
  89.         return $this->logoPath;
  90.     }
  91.     public function setLogoPath(?string $logoPath): self
  92.     {
  93.         $this->logoPath $logoPath;
  94.         return $this;
  95.     }
  96.     public function getPrimaryColor(): ?string
  97.     {
  98.         return $this->primaryColor;
  99.     }
  100.     public function setPrimaryColor(?string $primaryColor): self
  101.     {
  102.         $this->primaryColor $primaryColor;
  103.         return $this;
  104.     }
  105.     public function getSecondaryColor(): ?string
  106.     {
  107.         return $this->secondaryColor;
  108.     }
  109.     public function setSecondaryColor(?string $secondaryColor): self
  110.     {
  111.         $this->secondaryColor $secondaryColor;
  112.         return $this;
  113.     }
  114.     public function getLoginBackground(): ?string
  115.     {
  116.         return $this->loginBackground;
  117.     }
  118.     public function setLoginBackground(?string $loginBackground): self
  119.     {
  120.         $this->loginBackground $loginBackground;
  121.         return $this;
  122.     }
  123.     public function getIsActive(): bool
  124.     {
  125.         return (bool) $this->isActive;
  126.     }
  127.     public function setIsActive(bool $isActive): self
  128.     {
  129.         $this->isActive $isActive;
  130.         return $this;
  131.     }
  132.     public function __toString()
  133.     {
  134.         return (string) $this->name ?: (string) $this->code;
  135.     }
  136. }