src/Entity/Ajustes/Direccion.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Ajustes;
  3. use App\Repository\Ajustes\DireccionRepository;
  4. use Doctrine\Common\Collections\Criteria;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. /**
  8.  * @ORM\Entity(repositoryClass=DireccionRepository::class)
  9.  */
  10. class Direccion
  11. {
  12.     public const BASEDIR '/pages/privado/ajustes/direcciones';
  13.     public const ICON_CLASS 'fas fa-users-cog';
  14.     public const ICON '<i class="'.self::ICON_CLASS.'"></i>';
  15.     public const ESTADOS = [
  16.         'Activo'   => 1,
  17.         'Inactivo' => 0,
  18.     ];
  19.     /**
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue
  22.      * @ORM\Column(type="integer")
  23.      * @Groups({"Simple"})
  24.      */
  25.     private $id;
  26.      /**
  27.      * @Groups({"Simple"})
  28.      */
  29.     private $text;
  30.     /**
  31.      * @ORM\ManyToOne(targetEntity=Usuario::class, inversedBy="direcciones")
  32.      * @ORM\JoinColumn(nullable=false)
  33.      */
  34.     private $DirUser;
  35.     /**
  36.      * @ORM\Column(type="string", length=255)
  37.      */
  38.     private $DirAddress;
  39.     /**
  40.      * @ORM\Column(type="string", length=255)
  41.      */
  42.     private $DirCity;
  43.     /**
  44.      * @ORM\Column(type="string", length=255)
  45.      */
  46.     private $DirProvincia;
  47.     /**
  48.      * @ORM\Column(type="string", length=255)
  49.      */
  50.     private $DirPais;
  51.     /**
  52.      * @ORM\Column(type="string", length=255)
  53.      */
  54.     private $DirCodPostal;
  55.     /**
  56.      * @ORM\Column(type="boolean")
  57.      */
  58.     private $DirEnabled;
  59.     /**
  60.      * @ORM\Column(type="string", length=255, nullable=true)
  61.      */
  62.     private $DirTextoString;
  63.     public function __construct()
  64.     {
  65.         $this->DirEnabled true;
  66.     }
  67.     public function __toString(): string
  68.     {
  69.         return (string) $this->DirAddress.'-'.$this->DirCodPostal.' '.$this->DirCity.' ('.$this->DirProvincia.')'.' '.$this->DirPais;
  70.     }
  71.     public function getId(): ?int
  72.     {
  73.         return $this->id;
  74.     }
  75.     public function getText(): string
  76.     {
  77.         return (string) $this->__toString();
  78.     }
  79.     public function getDirUser(): ?Usuario
  80.     {
  81.         return $this->DirUser;
  82.     }
  83.     public function setDirUser(?Usuario $DirUser): self
  84.     {
  85.         $this->DirUser $DirUser;
  86.         return $this;
  87.     }
  88.     public function getDirAddress(): ?string
  89.     {
  90.         return $this->DirAddress;
  91.     }
  92.     public function setDirAddress(string $DirAddress): self
  93.     {
  94.         $this->DirAddress $DirAddress;
  95.         return $this;
  96.     }
  97.     public function getDirCity(): ?string
  98.     {
  99.         return $this->DirCity;
  100.     }
  101.     public function setDirCity(string $DirCity): self
  102.     {
  103.         $this->DirCity $DirCity;
  104.         return $this;
  105.     }
  106.     public function getDirProvincia(): ?string
  107.     {
  108.         return $this->DirProvincia;
  109.     }
  110.     public function setDirProvincia(string $DirProvincia): self
  111.     {
  112.         $this->DirProvincia $DirProvincia;
  113.         return $this;
  114.     }
  115.     public function getDirPais(): ?string
  116.     {
  117.         return $this->DirPais;
  118.     }
  119.     public function setDirPais(string $DirPais): self
  120.     {
  121.         $this->DirPais $DirPais;
  122.         return $this;
  123.     }
  124.     public function getDirCodPostal(): ?string
  125.     {
  126.         return $this->DirCodPostal;
  127.     }
  128.     public function setDirCodPostal(string $DirCodPostal): self
  129.     {
  130.         $this->DirCodPostal $DirCodPostal;
  131.         return $this;
  132.     }
  133.     public function getDirEnabled(): ?bool
  134.     {
  135.         return $this->DirEnabled;
  136.     }
  137.     public function getDirEnabledTag(): string
  138.     {
  139.         return $this->DirEnabled ?
  140.             '<div class="badge badge-light-success">Activo</div>' :
  141.             '<div class="badge badge-light-danger">Inactivo</div>'
  142.         ;
  143.     }
  144.     public function setDirEnabled(bool $DirEnabled): self
  145.     {
  146.         $this->DirEnabled $DirEnabled;
  147.         return $this;
  148.     }
  149.     public function getDirTextoString(): ?string
  150.     {
  151.         return $this->DirTextoString;
  152.     }
  153.     public function setDirTextoString(?string $DirTextoString): self
  154.     {
  155.         $this->DirTextoString $DirTextoString;
  156.         return $this;
  157.     }
  158. }